我刚醒来,无法使用 rails 启动Rails服务器。我收到以下错误:
$ rails s
c:/Sites/wtna/config/application.rb:9:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in `require'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in `block in perform'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `tap'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `perform'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke'
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
10个小时前,一切运行良好。有什么建议吗?
答案 0 :(得分:0)
事实证明,在 config / application.rb 中注释掉以下行(我从dotdotdotPaul:How can I completely disable CoffeeScript in a Rails 3.1 app?中摘录)解决了该问题:
config.generators.javascript_engine :js