[英]System rvm is not working on direct call
我正在使用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
所以它只是失敗了,所有的gem都安裝在默認的ruby上,而不是ruby-1.9.3-p392@gemset
感謝您的任何建議。
我的假設:
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: execute(:bundle,:install)和execute('bundle install')行為不同!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.