Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"rails generate rspec:install" seems to be failing

running: ruby 1.9.3p0 with Rails 3.2.1

Trying to use rspec but when I try to install it into my app I get the following error:

/Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `generators' for #<Rails::Railtie::Configuration:0x00000101b2f1b8> (NoMethodError)
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:4:in `<class:Railtie>'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:3:in `<module:Rails>'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:2:in `<module:RSpec>'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:1:in `<top (required)>'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
from /Users/Si/dropbox/sh_rails_projects/test_app/config/application.rb:13:in `<top (required)>'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:24:in `require'
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

I'm very new to rails and ruby so this means almost nothing to me, could anyone explain.

Thanks

like image 289
user1190654 Avatar asked Feb 10 '12 23:02

user1190654


1 Answers

It looks like your rspec-rails version is 2.0.0.beta... Try upgrading this to ~> 2.8, or if that's what you have specified on your Gemfile, run bundle exec rails g rspec:install

To update your gem version, your Gemfile you should have the following:

group :test, :development do
  gem "rspec-rails", "~> 2.8"
end

Once you've added that, run bundle update rspec-rails and try installing again and everything should be good as gold!

like image 174
Matthew Lehner Avatar answered Nov 02 '22 07:11

Matthew Lehner