rails生成脚手架错误

我正在研究RailsTutorial.org的书,我一直在遇到错误。 当我跑

rails generate scaffold User name:string email:string 

我收到以下错误:

 /Users/Cody/Development/rails_projects/demo_app/config/environments/development.rb:1:in `': undefined method `configure' for # (NoMethodError) 

我正在运行Ruby 2.0.0和Rails 4.0.4。 以下是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 

如果您需要查看更多代码段,请告诉我们。 任何帮助将不胜感激。

尝试:

  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