Dylan Richards
Dylan Richards

Reputation: 708

You have already activated rspec-support 3.0.0.beta1, but your Gemfile requires rspec-support 3.0.0.beta1

When I run

rspec spec/ 

in my command line, I receive the following error:

You have already activated rspec-support 3.0.0.beta1, but your Gemfile requires rspec-support 3.0.0.beta1. Using bundle exec may solve this. (Gem::LoadError)

I tried using bundle exec like the error suggests, but to no avail. It's weird that it's telling me that it requires a version that have already activated.

Upvotes: 8

Views: 5733

Answers (2)

Jason Swett
Jason Swett

Reputation: 45094

To me, prepending bundle exec seems like a workaround rather than a solution to the problem.

I added a .ruby-gemset file to my project's root directory (containing an arbitrary gemset name) and that fixed the problem. I believe you could do the following:

echo 'my-project-name' > .ruby-gemset
cd ..
cd my-project-directory
gem install bundler
bundle install
rspec spec

Upvotes: 2

marzapower
marzapower

Reputation: 5611

Try the complete command

bundle exec rspec spec/

In case this one do not work, try deleting the Gemfile.lock file and bundle install from scratch. Then retry.

Upvotes: 12

Related Questions