Question

I'm working on the RailsTutorial.org book and I keep hitting an error. When I run

rails generate scaffold User name:string email:string

I'm getting the following error:

/Users/Cody/Development/rails_projects/demo_app/config/environments/development.rb:1:in `<top (required)>': undefined method `configure' for #<DemoApp::Application:0x007fdcea90ae10> (NoMethodError)

I'm running Ruby 2.0.0 and Rails 4.0.4. Here is the contents of enviroments/development.rb

Rails.application.configure do
config.cache_classes = false
config.consider_all_requests_local       = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.raise_runtime_errors = true
end 

Please let me know if you need to see any more of the code snippets. Any help would be greatly appreciated.

Was it helpful?

Solution

try:

   DemoApp::Application.configure do
    config.cache_classes = false
    config.consider_all_requests_local       = true
    config.action_controller.perform_caching = false
    config.action_mailer.raise_delivery_errors = false
    config.active_support.deprecation = :log
    config.active_record.migration_error = :page_load
    config.assets.debug = true
    config.assets.raise_runtime_errors = true
   end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top