1

I'm trying to run rspec on my machine for the first time. I did gem install rspec in the global gemset. However, when I try to do

  spec intranet_reader_spec.rb

I get

-bash: spec: command not found

And when I try to do

bundle exec rspec spec intranet_reader_spec.rb

I get

Could not locate Gemfile

(Note, I don't have a gemfile. I'm just running one test script from a ruby book)

I found these instructions for adding spec to the path, i.e. put the following in bashrc

export PATH=$PATH:/Users/<UserName>/.gem/ruby/1.8/bin

However, that didn't work. I note that on my mac. if I navigate to .gem/ruby/1.8 and do 'ls', it doesn't have a 'bin.' In the 1.8 folder, it has

cache       doc     gems        specifications

Can anyone tell me what I might be doing wrong?

1 Answer 1

1

If you don't have a Gemfile then you can't run bundle exec.

Also, the command for RSpec 2.x is rspec. You might be following an outdated tutorial, since the command was spec in version 1.x.

Just run:

rspec intranet_reader_spec.rb
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.