Did I miss a step? thxs!
As you’ve installed your gems with Bundler, try this instead:
bundle exec rspec spec
Bundler doesn’t necessarily install gems in the standard location,
which is possibly why the rspec executable isn’t in your $PATH (which
is why you got the ‘command not found’ error). Either way, when you’re
using Bundler, you almost always want to run Ruby commands in the
context of the bundle, which is what bundle exec does.
Do you have RSpec installed (not as a bundler gem)? Bundler won’t
install binaries for you – will just load the correct Ruby classes. Try
installing RSpec with “gem install rspec” or “sudo gem install rspec”
(keep an eye on the gem version) and try again.
Ok this work, found here: http://gembundler.com/ (Also pasted below)
I hope it helps someone else finding this…
Run an executable that comes with a gem in your bundle
$ bundle exec rspec spec/models
In some cases, running executables without bundle exec may work, if
the executable happens to be installed in your system and does not
pull in any gems that conflict with your bundle.
However, this is unreliable and is the source of considerable pain.
Even if it looks like it works, it may not work in the future or on
another machine.
If you want a way to get a shortcut to gems in your bundle
$ bundle install --binstubs
$ bin/rspec spec/models
The executables installed into bin are scoped to the bundle and will
always work
B
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.