rails server not starting - undefined method`formatter' for nil:NilClass(NoMethodError)错误

时间:2014-07-02 13:36:26

标签: ruby-on-rails-4.1

我正在使用rails 4.1,但是当我尝试运行“轨道”时在终端上它给出了这个错误:

Exiting
/home/ben/.rvm/gems/ruby-2.0.0-p247@addtocartalerts/gems/railties-4.0.4/lib/rails/commands/server.rb:78:in `start': undefined method `formatter' for nil:NilClass (NoMethodError)
        from /home/ben/.rvm/gems/ruby-2.0.0-p247@addtocartalerts/gems/railties-4.0.4/lib/rails/commands.rb:76:in `block in <top (required)>'
        from /home/ben/.rvm/gems/ruby-2.0.0-p247@addtocartalerts/gems/railties-4.0.4/lib/rails/commands.rb:71:in `tap'
        from /home/ben/.rvm/gems/ruby-2.0.0-p247@addtocartalerts/gems/railties-4.0.4/lib/rails/commands.rb:71:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

请帮助

1 个答案:

答案 0 :(得分:1)

您没有使用rails 4.1。看看铁路宝石路径。它说铁路4.0.4

检查Gemfile是否正确。做bundle update rails。如果安装了多个rails gem,则使用binstubs或bundle exec rails s