Errors in user.rb after updating local to latest

the error log:

rake aborted!
SyntaxError: /home/ooops/discourse/app/models/user.rb:985: syntax error, unexpected '.'
    if group_from_email&.grant_trust_level &&
                         ^
/home/ooops/discourse/app/models/user.rb:1076: syntax error, unexpected keyword_end, expecting end-of-input
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:457:in `load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:457:in `block in load_file'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:647:in `new_constants_in'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:456:in `load_file'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:354:in `require_or_load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:494:in `load_missing_constant'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:184:in `const_missing'
/home/ooops/discourse/config/initializers/006-ensure_login_hint.rb:2:in `<top (required)>'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
/home/ooops/discourse/config/environment.rb:5:in `<top (required)>'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:328:in `require_environment!'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/home/ooops/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/home/ooops/.rbenv/versions/2.2.3/bin/bundle:23:in `load'
/home/ooops/.rbenv/versions/2.2.3/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)


Are you using Ruby 2.3 and above?

3 Likes