Gitlab is version 14.x gitlab-rails dbconsole无法进去

Gitlab is version 14.x 

gitlab-rails dbconsole

Traceback (most recent call last):

11: from bin/rails:4:in `

'

10: from bin/rails:4:in `require'

9: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/commands.rb:18:in `

quired)>'

8: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/command.rb:48:in `invoke'

7: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/command/base.rb:69:in `perf

orm'

6: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'

5: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_comma

nd'

4: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'

3: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/commands/dbconsole/dbconsol

e_command.rb:181:in `perform'

2: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/commands/dbconsole/dbconsol

e_command.rb:10:in `start'

1: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/commands/dbconsole/dbconsol

e_command.rb:19:in `start'

/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/commands/dbconsole/dbconsole_command.rb:108:

in `db_config': 'primary' database is not configured for 'production'. Available configuration: #

aseConfigurations:0x00007f7f468de3a8 @configurations=[#

8de218 @env_name="production", @name="main", @configuration_hash={:adapter=>"postgresql", :encoding=>"unicode", :coll

ation=>nil, :database=>"gitlabhq_production", :username=>"gitlab", :password=>nil, :host=>"/var/opt/gitlab/postgresql

", :port=>5432, :socket=>nil, :sslmode=>nil, :sslcompression=>0, :sslrootcert=>nil, :sslca=>nil, :load_balancing=>{"h

osts"=>[]}, :prepared_statements=>false, :statement_limit=>1000, :connect_timeout=>nil, :keepalives=>nil, :keepalives

_idle=>nil, :keepalives_interval=>nil, :keepalives_count=>nil, :tcp_user_timeout=>nil, :application_name=>nil, :varia

bles=>{"statement_timeout"=>nil}}>]> (ActiveRecord::AdapterNotSpecified)

以上为报错内容

对于 Omnibus GitLab 14.2 及更高版本:

用这个即可:

gitlab-psql -d gitlabhq_production

或者

sudo gitlab-rails dbconsole --database main //也能进但要点时间

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

良人眷

一分也是爱

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值