2014-07-18 35 views
1

我正在使用CentOS。这里是我的输出: 系统rvm无法直接拨打

# which rvm 
/usr/local/rvm/bin/rvm 
# rvm [email protected] 
# /usr/local/rvm/bin/rvm [email protected] 
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 [email protected] do bundle install --binstubs /var/www/app/shared/bin --path /var/www/app/shared/bundle --without development test --deployment --verbose 

所以它只是失败和所有宝石正在对默认红宝石,而不是[email protected]

感谢您的任何建议安装。

+0

也许试试'/ usr/bin/env rvm'? –

+0

你使用登录shell吗? https://rvm.io/integration/gnome-terminal – nsave

+0

@NickVeys'/ usr/bin/env rvm'产生与'rvm'和'/ usr/local/rvm/bin/rvm'相同的输出,但'/ usr/bin/env rvm ruby​​-1.9.3-p392'给我'RVM不是函数'。只有'rvm ruby​​-1.9.3-p392'按预期工作 @保存是我是 –

回答

1

我的假设:

  • 您使用Capistrano的V3
  • 在Capfile
  • 已经列入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;博士:执行(:束:安装)和执行('捆绑安装')不具有相同的行为!