我在将网站部署到AWS
时出现问题。
Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
/var/app/ondeck/config/boot.rb:3:in `<top (required)>'
/var/app/ondeck/config/application.rb:1:in `<top (required)>'
/var/app/ondeck/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/var/app/ondeck/config/boot.rb:3:in `<top (required)>'
/var/app/ondeck/config/application.rb:1:in `<top (required)>'
/var/app/ondeck/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
(ElasticBeanstalk::ExternalInvocationError)
当我做gem list rake
时,它给了我
*** LOCAL GEMS ***
airbrake (4.3.1)
rake (10.5.0, 10.4.2)
当我bundle exec gem uninstall rake -v 10.4.2
给我
ERROR: While executing gem ... (Gem::InstallError)
gem "rake" cannot be uninstalled because it is a default gem
如何解决此问题?任何帮助将不胜感激。
答案 0 :(得分:26)
首先运行捆绑更新rake 。
我希望这适合你。
答案 1 :(得分:10)
您需要在命令前添加bundle exec
。例如,如果您的rake
命令是
rake deploy
您可以使用
bundle exec rake deploy
Bundler将获取Gemfile
中列出的正确gem版本,然后执行命令。