RSpec exercise error

Hi,
I am working on rspec exercise 1.
‘bundle exec rspec’ works perfectly but when use ‘bundle exec rspec 00_hello_spec.rb’ to run the tests separately i get this error message:
LoadError: cannot load such file –
can someone help me on this please?

Since ‘bundle exec rspec’ works fine, my guess is your current working directory is the exercise file, which means that when you run an individual spec file you need to give the proper relative pathname, which is ‘spec/00_hello_spec.rb’. In other words, the 00_hello_spec.rb file isn’t visible immediately in your current directory, thus the LoadError.

What E_Milco said! Try running bundle exec rspec spec/00_hello_spec.rb.

2 Likes

Hey thanks,
I suspected that and actually changed the pathname to spec and lib separately but still getting the same error.
this is the full message :

~/Documents/App Academy/Alpha Course/Rspec/spec$ bundle exec rspec 00_hello_spec.rb

bundler: failed to load command: rspec (/Users/rmin/.rbenv/versions/2.3.1/bin/rspec)

LoadError: cannot load such file – 00_hello

cd back to into your Rspec/ folder, and then try running the command m1010j suggested above. Does that work?

It works! Thank you all!