Topic: rspec command not found

I'm going through an excellent tutorial at railstutorial.org. I'm stuck in the section on Testing Tools. When I enter "$ rspec spec/" from the terminal (Mac OS X 10.6) returns "-bash: rspec: command not found". I've had no luck solving this after 2 hours of trying. Any suggestions?

Re: rspec command not found

Have you got the gem installed?  Try:

sudo gem install rspec

If you are using RVM, do not use sudo.

Then retry

rspec spec

Re: rspec command not found

Thanks for replying to my post.

I followed your directions and did the 'sudo gem install rspec' and got the following responses:

**************************************************

  Thank you for installing rspec-1.3.0

  Please be sure to read History.rdoc and Upgrade.rdoc
  for useful information about this release.

**************************************************
Successfully installed rspec-1.3.0
1 gem installed
Installing ri documentation for rspec-1.3.0...
Installing RDoc documentation for rspec-1.3.0...
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc

I then entered "rspec specs/" and got the following response:
-bash: rspec: command not found

Still no luck. :-(  Any other suggestions?

Re: rspec command not found

BTW I am using RVM

Re: rspec command not found

Hi,

I was having the same issue following the tutorial but not using rvm and on ubuntu 10.04
added this to ~/.bashrc
PATH=$PATH:/usr/lib/ruby/gems/1.8/bin/
export PATH

save and then do:
source ~/.bashrc

Re: rspec command not found

For those who already have the PATH set up correctly but still have problems:

bundle exec rspec specs/

Last edited by sefo (2010-10-14 22:50:32)

Re: rspec command not found

I have the same issue following the tutorial but not using rvm and on windows XP, but
bundle exec rspec specs/  works for me.

Re: rspec command not found

I have the same issue following the tutorial but not using rvm and on windows XP, but
bundle exec rspec specs/  works for me.