Capistrano部署中未安装“Gem bundler”

时间:2012-03-03 02:25:20

标签: ruby-on-rails rvm capistrano bundler

这是Capistrano部署中rake导致的错误。该错误还会导致rails 3.1.3部署的回滚和故障(为单个用户安装了rvm)。

 ** [out :: 76.195.225.93] ←[31mERROR: Gem bundler is not installed, run `gem in
    command finished in 54ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/byop/releases/20120302230229; true"

gem list显示已安装bundler 1.0.22。什么可能导致错误?是因为rvm吗?非常感谢。

1 个答案:

答案 0 :(得分:0)

在deploy.rb中添加以下内容并成功部署后,错误消失了:

   task :gems, :roles => :web, :except => { :no_release => true } do 
     run "cd #{current_path}; #{shared_path}/bin/bundle unlock" 
     run "cd #{current_path}; nice -19 #{shared_path}/bin/bundle install vendor/" # nice -19 is very important otherwise DH will kill the process! 
     run "cd #{current_path}; #{shared_path}/bin/bundle lock" 
   end 

更多阅读:Bundle install failing when deploying a Rails 3 app to Dreamhost with Capistrano