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.

chris
  • 371
  • 1
  • 7
  • 18

5 Answers5

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)

Shlomo Zalman Heigh
  • 3,968
  • 8
  • 41
  • 71
  • 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 01 '11 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. – Shlomo Zalman Heigh Jun 01 '11 at 17:48
  • Your Gemfile.lock probably contains the older version because one of your gems requires that specific version. – Jits Jun 01 '11 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` – Shlomo Zalman Heigh Jun 01 '11 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. – Tobias Cohen Jun 01 '11 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

Community
  • 1
  • 1
Antonio
  • 151
  • 1
  • 5
2

Do you have...

gem 'rake', '0.8.7'

... in your Gemfile?

If so, remove it.

Jits
  • 9,647
  • 1
  • 34
  • 27
  • I do not have this in my gemfile. That is the first thing i checked. – chris Jun 01 '11 at 17:42
  • My gemfile contains: gem 'rails', '3.0.6'; gem 'sqlite3'; gem "will_paginate", "~> 3.0.pre2" AND gem 'mysql' – chris Jun 01 '11 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 01 '11 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.

Zameer Manji
  • 3,017
  • 5
  • 31
  • 42
0
bundle update rake

works fine for me :D

Shirow
  • 70
  • 9