我正在使用bundler和binstubs以及“rake rails:update:bin”,下次我尝试运行rails时,我遇到了这个例外:
`inherited': undefined method `application' for Rails:Module (NoMethodError)
即使是我创建并尝试运行的新项目,也会出现相同的异常。
以下是全文:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:63:in `inherited': undefined method `application' for Rails:Module (NoMethodError)
from F:/aptana projects/testy/config/application.rb:10:in `<module:Testy>'
from F:/aptana projects/testy/config/application.rb:9:in `<top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
答案 0 :(得分:1)
好吧,发帖后几分钟我试过了:
gem uninstall railties
然后再次
bundle install
它解决了这个问题。我仍然不知道最初可能发生了什么。