启动 Rails 服务器时收到以下错误消息:
您的捆绑包已锁定到 rake (12.0.0),但在 Gemfile 中列出的任何源中都找不到该版本。如果您没有更改源,则意味着 rake (12.0.0) 的作者已将其删除。您需要将捆绑包更新到尚未删除的不同版本的 rake (12.0.0) 才能安装。
我指定gem 'rake', '12.0.0'
在 gemfile 中,但这并不能解决问题。我试过bundle update rake
,删除Gemfile.lock
并生成它bundle exec bundle install
。我还在所有命令前添加了 `bundle exec 1 ,但它什么也不做。
我的 Gemfile.lock 已经指定 rake 版本 12.0.0,并且没有安装其他版本。
查看我的宝石文件:http://pastebin.com/L4tVFWz9 http://pastebin.com/L4tVFWz9
和 rakefile:http://pastebin.com/K7p2ajsE http://pastebin.com/K7p2ajsE
我尝试了中建议的解决方案已激活的 rake 版本与 Gemfile 要求的版本不同,会阻止 rake 命令 https://stackoverflow.com/questions/23287357/already-activated-rake-version-different-than-what-gemfile-requires-prevents-rak
解决这个问题的不同方法,
Step1:
gem install rubygems-bundler
gem regenerate_binstubs
Step2:
删除vendor/bundle目录。
Run bundle install
重建它
Step3:
Try, gem update bundler
这是解决问题的链接。检查一下这个非常有用 https://github.com/bundler/bundler/issues/5068
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)