简体   繁体   English

Capistrano部署中未安装“Gem bundler” - 错误消息UPDATED

[英]“Gem bundler is not installed” in Capistrano deployment - Error message UPDATED

Here is the error caused by rake in Capistrano deployment. 这是Capistrano部署中rake导致的错误。 The error also causes the rollback and failure of the rails 3.1.3 deployment (with rvm for single user installed). 该错误还会导致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 shows bundler 1.0.22. gem list显示bundler 1.0.22。 Also bundler was added to default.gems and global.gems under .rvm/gemset/. Bundler也被添加到.rvm / gemset /下的default.gems和global.gems中。 What could cause the error? 什么可能导致错误? Thanks so much. 非常感谢。

Set the default environment in deployment recipe: 在部署配方中设置默认环境:

set :default_environment, {
'RUBY_VERSION' => 'ruby-1.9.2-p320',
'LANG'         => 'en_US.UTF-8',
'GEM_HOME'     => '/usr/local/rvm/gems/ruby-1.9.2-p320',
'GEM_PATH'     => '/usr/local/rvm/gems/ruby-1.9.2-p320:/usr/local/rvm/gems/ruby-1.9.2-p320@global',
'BUNDLE_PATH'  => '/usr/local/rvm/gems/ruby-1.9.2-p320:/usr/local/rvm/gems/ruby-1.9.2-p320@global'
}

You can have just bundle path in your case! 您可以在您的案例中拥有捆绑路径!

I had the same problem. 我有同样的问题。 Check and see if there is a file called rvm.sh in your /etc/profile.d directory. 检查并查看/etc/profile.d目录中是否有名为rvm.sh/etc/profile.d If so, then you installed rvm in multiuser mode. 如果是这样,那么您在多用户模式下安装了rvm I fixed it on my server (Ubuntu 12.04) by adding source /etc/profile to my .bashrc file in my home directory on that machine. 我通过在我的主机上的.bashrc文件中添加source /etc/profile来修复它在我的服务器(Ubuntu 12.04)上。

If you have bundler installed in an RVM gemset on the remote server, be sure to: 如果您在远程服务器上的RVM gemset中安装了bundler,请务必:

require 'rvm/capistrano'

if your config/deploy.rb 如果你的config / deploy.rb

If you get an error for that require, you might need to fix your rvm path as well in deploy.rb using: 如果您遇到该要求的错误,您可能需要在deploy.rb中修复您的rvm路径:

$:.unshift(File.expand_path('./lib', ENV['rvm_path']))

I prefer that to just installing gems as system gems. 我更喜欢将宝石作为系统宝石安装。 RVM is your friend. RVM是你的朋友。

您需要在服务器gemset中安装bundler。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM