10

Noob trying to decipher what to do with the following error:

rake aborted! You have already activated rake 0.9.1, but your Gemfile requires rake 0.8.7. Consider using bundle exec.

Any help is greatly appreciated.

1

5 Answers 5

13

Try running bundle exec rake instead of just rake. This error will occur when you have a newer version of rake installed on your computer than the one specified in your Gemfile (or Gemfile.lock)

5
  • 1
    bingo... gemfile.lock does contain the older version. should i simply change the file to reflect the newer version. This would avoid having to run bundle exec... correct?
    – chris
    Jun 1, 2011 at 17:46
  • 3
    Run bundle update and it will do it for you. bundle update updates all the gem versions in your Gemfile.lock to the newest versions. Jun 1, 2011 at 17:48
  • Your Gemfile.lock probably contains the older version because one of your gems requires that specific version.
    – Jits
    Jun 1, 2011 at 17:48
  • 4
    @Jist: That is possible, but running bundle update will update that gem to the newest version also, which may or may not fix this. If it doesn't, then you can uninstall the newer version of rake with gem uninstall rake -v 0.9.1 Jun 1, 2011 at 17:51
  • 3
    @chris never manually modify Gemfile.lock. You can, and should, run bundle update from time to time to update all of your installed gems. Do make sure you have a good test suite prepared, and then run it in full after doing an update. You may be surprised how many gem updates contain changes that will break your code. Jun 1, 2011 at 23:06
4

This worked for me:

  1. Add rake 0.8.7 to your Gemfile

    gem 'rake', '0.8.7'
    
  2. remove rake 0.9.1 by doing

    gem uninstall rake -v=0.9.1
    
  3. run bundle update on the terminal

    bundle update
    

Hope that helps. Thanks

Antonio

2

Do you have...

gem 'rake', '0.8.7'

... in your Gemfile?

If so, remove it.

3
  • I do not have this in my gemfile. That is the first thing i checked.
    – chris
    Jun 1, 2011 at 17:42
  • My gemfile contains: gem 'rails', '3.0.6'; gem 'sqlite3'; gem "will_paginate", "~> 3.0.pre2" AND gem 'mysql'
    – chris
    Jun 1, 2011 at 17:43
  • OK. Sounds to me like a conflict between dependencies of your gems in your Gemfile. An alternative is to lock your rake version to 0.9.1 in your Gemfile.
    – Jits
    Jun 1, 2011 at 17:47
1

This error is a result of having rake 0.9.1 installed on your system but your rake file specifying 0.8.7. You can do bundle exec rake to use rake 0.8.7 or change the version of rake that you need.

0
bundle update rake

works fine for me :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.