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.

自闭症网瘾萝莉.ら 提交于 2019-11-30 17:46:11

问题


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


回答1:


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




回答2:


Try:

gem install rubygems-bundler

gem regenerate_binstubs




回答3:


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.



来源:https://stackoverflow.com/questions/41757144/your-bundle-is-locked-to-rake-12-0-0-but-that-version-could-not-be-found-in-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!