【发布时间】:2016-01-27 08:19:18
【问题描述】:
我在将我的网站部署到 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
如何解决这个问题?任何帮助将不胜感激。
【问题讨论】:
-
将
bundle exec添加到您运行以给出错误的任何命令之前,就像错误告诉您的那样。 -
我在尝试使用 WSL 在 VSCode 上调试 RoR 时遇到了这个错误。我通过将“useBundler”:true 添加到我的launch.json 来解决这个问题。 VSCode 抛出这个错误是我在这里结束的原因。
标签: ruby-on-rails ruby rubygems bundler