Your bundle is locked to rake (12.0.0), but that version could not be found in any of the sources listed in your Gemfile.

danielbker picture danielbker · Jan 20, 2017 · Viewed 16.7k times · Source

I get the following error message when starting the rails server:

Your bundle is locked to rake (12.0.0), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of rake (12.0.0) has removed it. You'll need to update your bundle to a different version of rake (12.0.0) that hasn't been removed in order to install.

I specified gem 'rake', '12.0.0' in the gemfile but that doesn't fix it. I tried bundle update rake, deleting the Gemfile.lock and generating it with bundle exec bundle install. I also prepended `bundle exec1 to al my commands which does nothing.

My Gemfile.lock already specifies rake version 12.0.0, and there are no other versions installed.

See my gemfile: http://pastebin.com/L4tVFWz9

And rakefile: http://pastebin.com/K7p2ajsE

I tried the solutions suggested in Already activated rake version different than what Gemfile requires prevents rake commands

Answer

Sravan picture Sravan · Jan 20, 2017

Different methods to solve this issue,

Step1:

gem install rubygems-bundler
gem regenerate_binstubs

Step2:

Remove the vendor/bundle directory.

Run bundle install to rebuild it

Step3:

Try, gem update bundler

Here is a link where the issue got solved. Check this is very useful