main:Object 的未定义局部变量或方法`config' - rails [英] undefined local variable or method `config' for main:Object - rails

查看:41
本文介绍了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.

这篇关于main:Object 的未定义局部变量或方法`config' - rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆