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 :(得分:0)
您的application.rb
文件中有错误。
检查以下行:
if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
应该用
代替Bundler.require(:default, Rails.env) if defined?(Bundler)
根据NeoRiddler的this answer