部署 Capistrano - Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources

larryzhao · 2012年06月27日 · 最后由 larryzhao 回复于 2012年07月02日 · 7491 次阅读

我在使用 Capistrano 部署应用到服务器上去,但是当执行到deploy:assets:precompile的时候会报错Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources.

执行的命令是: cd /opt/app/deploy/entercamp/releases/20120627132117 && /usr/local/rvm/rubies/jruby-1.6.7/bin/jruby --1.9 -S bundle exec rake RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile

我在服务器上手动运行这个命令是没有任何问题的,并且在 capistrano 执行前面一步bundle install的输出结果里面,我也发现rake-0.9.2.2是在里面的。

这会是什么问题呢?求解

我在使用的是: gem "capistrano", "~> 2.12.0" gem 'capistrano-ext', "~> 1.2.1"

详细信息请看:https://gist.github.com/3005237

试试在 deploy.rb 加上 require "bundler/capistrano"

有没有用到 RVM?如果有,试试 https://rvm.io//integration/capistrano/

#1 楼 @HungYuHei 都用到了,我之前信息可能给的不够,现在编辑了,信息都在主贴的 gist 里

需要 登录 后方可回复, 如果你还没有账号请 注册新账号