2012-02-17 101 views
0
C:\Sites\demo_app>rails generate scaffold User name:string email:string 
C:/Sites/demo_app/config/application.rb:7:in `<top (required)>': undefined metho 
d `groups' for Rails:Module (NoMethodError) 
     from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.0.9 
/lib/rails/commands.rb:15:in `require' 
     from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.0.9 
/lib/rails/commands.rb:15:in `<top (required)>' 
     from script/rails:6:in `require' 
     from script/rails:6:in `<main>' 

回答

0

您的application.rb文件中出現錯誤。

檢查下列行:

if defined?(Bundler) 
    Bundler.require(*Rails.groups(:assets => %w(development test))) 
end 

它們應該與

Bundler.require(:default, Rails.env) if defined?(Bundler) 

根據this answer由NeoRiddler

取代