我正在使用CentOS。这是我的输出:
# which rvm
/usr/local/rvm/bin/rvm
# rvm ruby-1.9.3-p392@gemset
# /usr/local/rvm/bin/rvm ruby-1.9.3-p392@gemset
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
正如您所看到的,我是否只使用rvm
一切正常。但是capistrano
在这样的命令中使用完整路径
[46f28bd9] Command: cd /var/www/app/releases/20140718172057 && /usr/local/rvm/bin/rvm ruby-1.9.3-p392@gemset do bundle install --binstubs /var/www/app/shared/bin --path /var/www/app/shared/bundle --without development test --deployment --verbose
因此它失败并且所有宝石都安装在默认的ruby而不是ruby-1.9.3-p392@gemset
感谢您的任何建议。
答案 0 :(得分:1)
我的假设:
require 'capistrano/rvm'
cd
进入项目目录时,您可以使用.ruby-version
和.ruby-gemset
为您设置RVM。你可能想尝试这样的事情
within fetch(:current_path) do
with rails_env: fetch(:rails_env) do
execute :bundle, "install"
end
end
任务在v3中的工作方式不同:https://github.com/capistrano/capistrano#tasks
tl; dr:执行(:捆绑,:安装)和执行('捆绑安装')不要表现相同!