当我尝试启动我的 rails 控制台时,我收到以下错误,
/usr/lib/ruby/vendor_ruby/rails/railtie/configuration.rb:95:in `method_missing': undefined method `load_defaults' for #<Rails::Application::Configuration:0x000055af3aee4550> (NoMethodError)
from /home/alizain/www/WorkStationMetrices/config/application.rb:12:in `<class:Application>'
from /home/alizain/www/WorkStationMetrices/config/application.rb:10:in `<module:WorkstationMetrics>'
from /home/alizain/www/WorkStationMetrices/config/application.rb:9:in `<top (required)>'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /home/alizain/www/WorkStationMetrices/vendor/bundle/ruby/2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'
我该如何解决这个问题?
根据给出的错误堆栈,似乎您在应用程序加载期间加载配置时遇到了问题。
下面提到的链接也解决了同样的问题。
尝试在 Heroku 上部署应用程序时出现错误"找不到的方法"load_defaults">
希望对您有所帮助!!