Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 919
Dylan Richards Avatar asked Nov 18 '13 23:11

Dylan Richards


2 Answers

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.

like image 97
marzapower Avatar answered Nov 14 '22 23:11

marzapower


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
like image 2
Jason Swett Avatar answered Nov 15 '22 00:11

Jason Swett