Nicolo77
Nicolo77

Reputation: 1875

config undefined in environment specific configuration files

When I start my server locally, I get the following notice:

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

When I add in config/environments/development.rb

config.active_support.deprecation = :log 

I get:

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

my environment: Rails 3.0.1 Ruby 1.8.7 Ubuntu 10.04

Development.rb file

# 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

Upvotes: 2

Views: 12597

Answers (3)

Erick Eduardo Garcia
Erick Eduardo Garcia

Reputation: 1157

Try this

 rails s -e development

Upvotes: 0

Adam Tanner
Adam Tanner

Reputation: 927

In your development.rb it should have a block that looks like:

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

The config lines must be placed inside that block.

Upvotes: 11

Jaime Bellmyer
Jaime Bellmyer

Reputation: 23307

Make sure you add the line where the other config.* options are - inside the *.configure loop.

Upvotes: 1

Related Questions