我刚刚开始使用新的rails应用,但在输入' rails s'后,它不能让我启动服务器。控制台只是让我解决了这个问题;
/Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `load_defaults' for #<Rails::Application::Configuration:0x007fa393f7db20> (NoMethodError)
from /Users/user/Desktop/MiProyecto/Portafolio/config/application.rb:12:in `<class:Application>'
from /Users/user/Desktop/MiProyecto/Portafolio/config/application.rb:10:in `<module:Portafolio>'
from /Users/user/Desktop/MiProyecto/Portafolio/config/application.rb:9:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-4.2.9/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:9:in `require'
from bin/rails:9:in `<main>'
有什么想法? 提前谢谢。
ps:我已经运行了bundle install,它完全没问题。
答案 0 :(得分:1)
检查启动应用程序的Rails版本。如果你有任何改变它,升级或降级它,那么,为了确保,尝试删除Gemfile.lock文件,添加&#34;原始&#34; Rails版本并再次捆绑。
我重现'method_missing': undefined method 'load_defaults'
错误,首先使用5.1.3版本创建一个空白的Rails应用程序,然后将其更改为5.0.1,删除Gemfile.lock并运行bundle
。