main:Object 的未定义局部变量或方法`config' - rails
问题描述:
运行 rails 应用程序时,出现以下错误:
When I run the rails application, I get the following error:
main:Object 的未定义局部变量或方法config"
undefined local variable or method "config" for main:Object
我该如何解决?
答
我猜你发现了一些来自旧版 rails 的代码示例,它要求你在你的 environment.rb 文件中放置一个 config.gem *.要解决此问题,请将 gem 要求添加到您的 gemfile 中.
My guess is that you found some code examples from an older version of rails, which called for you to place a config.gem * in your environment.rb file. To fix this add the gem requirement to your gemfile.