- 502
端口被占用
- 初始化密码
GitLab 版本不同,命令会有所不同(网上说的而基本都是gitlab-rails console production ),推荐大家直接上 GitLab 官网去找对应版本的命令
我测是使用gitlab-rails console production是进不去GitLab 控制台的
我用
[root@localhost bin]# gitlab-rails console -e production
--------------------------------------------------------------------------------
Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
GitLab: 14.2.2 (8d08c6cbe51) FOSS
GitLab Shell: 13.19.1
PostgreSQL: 12.7
--------------------------------------------------------------------------------
Loading production environment (Rails 6.1.3.2)
irb(main):001:0> user.password = 12345678
Traceback (most recent call last):
1: from (irb):1
NameError (undefined local variable or method `user' for main:Object)
Did you mean? super
irb(main):002:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):003:0> user.password = 12345678
=> 12345678
irb(main):004:0> user.password_confirmation = 12345678
=> 12345678
irb(main):005:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: b298a78a-c8e6-4794-acb4-547a2969878e) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f2a18cfa3c0 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):006:0> exit
网友评论