“未定义的方法'组'用于Rails:模块”在Mac上运行“rails generate rspec:install”时

时间:2011-10-31 23:03:41

标签: ruby

$ rails generate rspec:install

/Users/AlbertoRDZ/Desktop/rails_projects/sample_app/config/application.rb:7:in `<top (required)>': undefined method `groups' for Rails:Module (NoMethodError)
    from /Users/AlbertoRDZ/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/commands.rb:15:in `require'
    from /Users/AlbertoRDZ/.rvm/gems/ruby-1.9.2-p290/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>'

1 个答案:

答案 0 :(得分:1)

也许它适用于以下内容:

config/application.rb替换

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

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