2010-10-28 83 views
2

當我開始我的本地服務器,我得到通知如下:配置未定義特定的配置文件

please set config.active_support.deprecation to :log at config/environments/development.rb 

當我在配置/環境添加/ development.rb

config.active_support.deprecation = :log 

我得到:

undefined local variable or method `config' for main:Object (NameError) 

我的環境: 的Rails的Ruby 3.0.1的Ubuntu 1.8.7 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 

回答

11

在你development.rb它應該有一個看起來像塊:

YourApplicationName::Application.configure do 
    config.active_support.deprecation = :log 
    config.cache_classes = false 
end 

的配置線必須放置在該塊內。

1

請確保您添加在其他配置*選項行 - 在* .configure循環中。

+0

我很困惑。任何東西confing。*在config/environments/development.rb文件中給出同樣的錯誤 – Nicolo77 2010-10-28 16:16:37

+0

你可以發佈一些/你所有的development.rb文件嗎? – 2010-10-28 16:23:40

0

試試這個

rails s -e development