4

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

Community
  • 1
  • 1
danielbker
  • 392
  • 1
  • 3
  • 21

4 Answers4

5

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

Sravan
  • 18,467
  • 3
  • 30
  • 54
1

Try:

gem install rubygems-bundler

gem regenerate_binstubs

Jyoti mishra
  • 597
  • 4
  • 16
1

Not really a fundamental solution, but if you really have to run some Rails commands urgently and needs a temporary fix, try bundle exec rails c rather than bin/rails c.

Quv
  • 2,958
  • 4
  • 33
  • 51
0

Enter command :-

bundle update rake
Pradnyesh patil
  • 271
  • 3
  • 3