Evolve
Evolve

Reputation: 9193

Rspec won't run - Error: In `bin_path': can't find executable spec for rspec-2.0.0.beta.22 (Gem::Exception)

When I run spec from the command prompt on my rails app.

$ spec spec

I get the following error:

/Library/Ruby/Site/1.8/rubygems.rb:335:in `bin_path': can't find executable spec for rspec-2.0.0.beta.22 (Gem::Exception) from /usr/bin/spec:19

However when I run

$ rake spec

The tests run fine.

What's the issue?

Upvotes: 15

Views: 4356

Answers (3)

Amrit Dhungana
Amrit Dhungana

Reputation: 4485

Run $ rspec spec/

not $ spec spec/

Upvotes: 0

Tinco
Tinco

Reputation: 607

For people who are working with outdated projects suffering from this problem, you can fix this error by doing:

which spec

Then open that file in your favourite file editor and change line 11 which looks like

version = '>= 0'

To

version = '< 2'

And your spec command will work again :)

Upvotes: 0

Robert Speicher
Robert Speicher

Reputation: 15552

The spec command was renamed to rspec in 2.0. You're still able to run it because the 1.x Gem is still on your system, it's just "hidden" by Bundler when you specify 2.x in your Gemfile.

Upvotes: 24

Related Questions