views:

54

answers:

2

Hi, trying to learn ruby on rails at the moment and currently learning about testing. The tutorial I'm following uses rspec, so I ran the commands:

sudo gem install rspec
sudo gem install rspec-rails
script/generate rspec

only to get an error message "Couldn't find 'rspec' generator". I've searched for an answer on this topic but I can't find a clear one anywhere.

I'm running Ubuntu 10.10, with ruby 1.8.7, rails 2.3.5 and rspec/rspec-rails 2.0.0

Any ideas how to get this generator to work?

A: 

in config/environments/test.rb:

config.gem 'rspec', :lib => false
config.gem 'rspec-rails', :lib => false

See if that doesn't help.

Steve Ross
A: 

For Rails 2 you need to install rspec-rails-1.3.3 or older. rspec-rails-2.0.0 does not support rails 2.

David Chelimsky