root@gitlab:/# gitlab-rails console production
DEPRECATION WARNING: Passing the environment's name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -e option instead. (calledfrom require at bin/rails:4)
--------------------------------------------------------------------------------
GitLab: 12.1.1 (f9abaa7d833)
GitLab Shell: 9.3.0
PostgreSQL: 10.7
--------------------------------------------------------------------------------
Loading production environment (Rails 5.2.3)
irb(main):001:0>
irb(main):002:0>
irb(main):003:0>
irb(main):004:0> user = User.find_by(name:'hupubao')
=> #<User id:3 @hekai>
irb(main):005:0> user.password='heiheihei123456'
=> "hk123456"
irb(main):006:0> user.password_confirmation='heiheihei123456'
=> "hk123456"
irb(main):007:0> user.save
Enqueued ActionMailer::DeliveryJob (Job ID: 9f085ed8-2bb7-4009-80bd-dc3c9340c2ba) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f6382ae0cd0 @uri=#<URI::GID gid://gitlab/User/3>>
=> true
10
15
gilab重置密码
分享到: