You have already activated rake 0.9.0, but your Gemfile requires rake 0.8.7

Ruby on-RailsRake

Ruby on-Rails Problem Overview


I'm trying to run rails project, I get

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

If I do: "bundle install"

but I'm getting

You have already activated rake 0.9.0, but your Gemfile requires rake 0.8.7

while doing

rake db:migrate

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

First, check to make sure that rake is mentioned in your Gemfile. If it's not, add it, and specify the version "you already activated".

Then, you'll need to tell bundle to update the rake version it's using for your app:

bundle update rake

It'll update your Gemfile.lock for you.

Solution 2 - Ruby on-Rails

Where you are currently using rake commands like

rake db:migrate

Use this instead:

bundle exec rake db:migrate

this will be the case until the latest version of rails and/or rake work well together.

Solution 3 - Ruby on-Rails

I thank to Dobry Den, cheers dude. but little more I had to do. here is solution (works for me). I had added

gem 'rake','0.8.7'

on Gemfile, which was not there, but my new version of rails automatically install rake(0.9.0).

after I had delete rake0.9.0 by gem uninstall rake and after doing bundle update rake , I can create and migrate database.

Solution 4 - Ruby on-Rails

Rake 0.9.0 breaks rails.

See here: https://stackoverflow.com/questions/6075997/rake-0-9-0-undefined-method-task

Use bundle exec rake instead of rake to run rake at the correct version.

Solution 5 - Ruby on-Rails

Specify the version that you want in your Gemfile.

gem 'rake', '0.9.0' 

then

bundle update rake

you need to use bundle exec to run your rake task

bundle exec rake db:migrate

Solution 6 - Ruby on-Rails

Oh look, it's the future. For me, it was complaining I had rake 10.x installed when it wanted 0.9.5. Not quite sure, not familiar enough with Ruby to really dig into what happened to the recent version numbers, but what I did was:

gem uninstall rake
gem install rake -v 0.9.5

to force the system to install the version of rake that the app wanted (for me it was Octopress).

Solution 7 - Ruby on-Rails

I had this problem (with another gem that was not rake) and I was able to fix it by

gem uninstall <complaining gem>
gem install <complaining gem>

bundle install
bundle update

Note that the keyword 'sudo' was not used (ie. sudo bundle install) as that may place your gem into directories where your rails app might not be searching in.

Solution 8 - Ruby on-Rails

Add this to your Gemfile

# Rake 0.9.0 break Rails.
gem "rake", "!= 0.9.0"

And then uninstall rake-0.9.0

Solution 9 - Ruby on-Rails

If I understand what you're not asking, you need to open your Gemfile file and change the line...

gem 'rake', '0.8.7'

...to...

gem 'rake', '0.9.0'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMujah MaskeyView Question on Stackoverflow
Solution 1 - Ruby on-RailsdanneuView Answer on Stackoverflow
Solution 2 - Ruby on-RailsFloyd PriceView Answer on Stackoverflow
Solution 3 - Ruby on-RailsMujah MaskeyView Answer on Stackoverflow
Solution 4 - Ruby on-Railssj26View Answer on Stackoverflow
Solution 5 - Ruby on-RailshacksignalView Answer on Stackoverflow
Solution 6 - Ruby on-RailssubdigitView Answer on Stackoverflow
Solution 7 - Ruby on-RailsglacierView Answer on Stackoverflow
Solution 8 - Ruby on-Railsuser769484View Answer on Stackoverflow
Solution 9 - Ruby on-RailsOlivier L.View Answer on Stackoverflow