[root@gitlab etc]# gitlab-rails console production
git
Loading production environment (Rails 4.2.7.1)web
irb(main):001:0> user = User.where(id: 1).firstruby
=> #<User id: 1, email: "admin@example.com", created_at: "2017-01-06 07:47:39", updated_at: "2017-01-11 07:25:07", name: "Administrator", admin: true, projects_limit: 10, skype: "", linkedin: "", twitter: "", authentication_token: "EujTJzBxtoGNRCFf1enZ", theme_id: 2, bio: nil, username: "root", can_create_group: true, can_create_team: false, state: "active", color_scheme_id: 1, password_expires_at: nil, created_by_id: nil, last_credential_check_at: nil, avatar: nil, hide_no_ssh_key: false, website_url: "", notification_email: "admin@example.com", hide_no_password: false, password_automatically_set: false, location: nil, encrypted_otp_secret: nil, encrypted_otp_secret_iv: nil, encrypted_otp_secret_salt: nil, otp_required_for_login: false, otp_backup_codes: nil, public_email: "", dashboard: 0, project_view: 0, consumed_timestep: nil, layout: 0, hide_project_limit: false, otp_grace_period_started_at: nil, ldap_email: false, external: false, organization: nil>ssh
irb(main):002:0> user = root.where(id: 1).firstide
NameError: undefined local variable or method `root' for main:Objectgitlab
from (irb):2ui
from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/console.rb:110:in `start'url
from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/console.rb:9:in `start'spa
from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:68:in `console'code
from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:9:in `require'
from bin/rails:9:in `<main>'
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::DeliveryJob (Job ID: b5ff06b5-930e-4f72-927e-9280ea98a02e) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):006:0> quit