1

When I run rspec from my rubymine editor,I get this error:

You have already activated rake 10.0.3, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.

I also tried this:

gem uninstall rake -v 10.0.3

But I get the following message:

INFO:  gem "rake" is not installed

bundle update rake fixes the issue for the command line.

But I still get the "already activated rake error" when i run rspec through command line. I am not sure how to resolve this. I want to run 0.9.6 Do i have to update the gem file. I cannot update it and push it to remote repo because this is a shared repo everybody will be using.

newbie
  • 1,023
  • 20
  • 46
  • Please follow this http://stackoverflow.com/questions/6080040/you-have-already-activated-rake-0-9-0-but-your-gemfile-requires-rake-0-8-7 Thanks – Rajarshi Das Jun 12 '13 at 05:19

3 Answers3

3

If you are using a gemset for your project try this in RubyMine:

Go to Settings and select Ruby SDK and Gems from the Project Settings section in the left-hand pane. In the right-hand pane find rake in the list of gems and you'll probably see both 10.0.3 & 0.9.6 listed. Check the Ignore global gempath check-box and you should now see just the rake 0.9.6 version listed. Hit OK and that should do it.

t0ne
  • 159
  • 7
  • +1, i'll never have to fire up a console and type `bundle exec rake db:migrate` again. thanks ! – m_x Jul 03 '13 at 07:56
1

You could try bundle update to fix dependency issues. I had the same problem and this solved it.

dalvallana
  • 469
  • 6
  • 13
0

Take a look at version of rake your Gemfile specifies that rails should use. It could be that your bundle update command is upgrading to a version higher than what other dependent gems expect to be available.

I would once more uninstall the gem as you've already done, and then write the following line in your Gemfile:

gem 'rake', '0.9.6'

Then run a bundle install instead of bundle update.

  • I actually like to use `bundle exec` only as a last resort. If all your gem versions match up correctly, then you shouldn't need it at all. It's bundler's job to keep track of this, and it generally does a pretty good job, especially when mixed with rvm to keep different project versions separate. – Luke Morris Mar 29 '13 at 22:53
  • @LukeMorris ..it didnt work. also, i no longer can run gem uninstall rake -v 10.0.3. Like i mentioned above it gives an error " When I run rspec from my rubymine editor,I get this error: You have already activated rake 10.0.3, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this. I also tried this: gem uninstall rake -v 10.0.3 But I get the following message: INFO: gem "rake" is not installed" – newbie Apr 01 '13 at 16:15