Ruby on rails 在特定于环境的配置文件中未定义配置

Ruby on rails 在特定于环境的配置文件中未定义配置,ruby-on-rails,ruby,Ruby On Rails,Ruby,当我在本地启动服务器时,会收到以下通知: please set config.active_support.deprecation to :log at config/environments/development.rb 当我添加config/environments/development.rb时 config.active_support.deprecation = :log 我得到: undefined local variable or method `config' for m

当我在本地启动服务器时,会收到以下通知:

please set config.active_support.deprecation to :log at config/environments/development.rb
当我添加config/environments/development.rb时

config.active_support.deprecation = :log 
我得到:

undefined local variable or method `config' for main:Object (NameError)
我的环境: Rails 3.0.1 Ruby 1.8.7 Ubuntu 10.04

Development.rb文件

# Settings specified here will take precedence over those in config/environment.rb

# In the development environment your application's code is reloaded on
# every request.  This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.active_support.deprecation = :log
config.cache_classes = false

确保在*.configure循环中添加其他config.*选项所在的行。

在development.rb中,它应该有一个如下所示的块:

YourApplicationName::Application.configure do
   config.active_support.deprecation = :log
   config.cache_classes = false
end
配置行必须放在该块内。

试试这个

 rails s -e development

我很困惑。Anything confing.*在config/environments/development.rb文件中给出了相同的错误。您可以发布部分/全部development.rb文件吗?