1

这就是我为什么要进行上限部署的原因 ** [deploy:update_code] exception while rolling back: Capistrano::CommandError, failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'ruby-1.9.3-p327@faxattach' -c 'rm -rf /srv/faxattach/releases/20130703184411; true'" on faxattach-staging-new failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'ruby-1.9.3-p327@faxattach' -c 'git clone -q git@github.com:chintanparikh/faxattach.git /srv/faxattach/releases/20130703184411 && cd /srv/faxattach/releases/20130703184411 && git checkout -q -b deploy a237b155f1fe4acef23ad4b594749c567a213117 && (echo a237b155f1fe4acef23ad4b594749c567a213117 > /srv/faxattach/releases/20130703184411/REVISION)'" on faxattach-staging-new

看起来问题出在 rvm_path 中。我的 rvm 路径是/usr/local/rvm,但我不知道如何改变它 -

这是我的 sinatra 应用程序中的 deploy.rb:

require 'capistrano/ext/multistage'
require 'rvm/capistrano'

set :stages, %w(production staging development)
set :default_stage, "staging"

set :rvm_ruby_string, 'ruby-1.9.3-p327@faxattach'
set :rvm_type, :user

# Bundler tasks
# require 'bundler/capistrano'
set :application, 'faxattach'
set :apikey, 'MHaBUh3Kctz2x500l5LPMFjo9LNLDKfl6EHF69C1Fq2WrIuB66yw6k5xj30dI17IZ'
set :ssh_options, {forward_agent: true}
# do not use sudo
set :use_sudo, false
set(:run_method) { use_sudo ? :sudo : :run }

# # needed to correctly handle sudo password prompt
default_run_options[:pty] = true

set :user, 'faxattach'
set :group, 'faxattach'
set :runner, 'faxattach'

# Where will it be located on the server?
set :deploy_to, "/srv/#{application}"
set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb"
set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"

# Unicorn control tasks
namespace :deploy do
  task :restart do
    run "if [ -f #{unicorn_pid} ] && [ -e /proc/`cat #{unicorn_pid}` ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && API_KEY=#{apikey} bundle exec unicorn -c #{unicorn_conf} -E #{rails_env} -D; fi"
  end
  task :start do
    run "cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} -E #{rails_env} -D"
  end
  task :end do
    run "if [ -f #{unicorn_pid} ]; then kill -QUIT `cat #{unicorn_pid}`; fi"
  end
end

任何想法我将如何更改 rvm 路径?

4

1 回答 1

2

:rvm_type通过将 设置为修复了该问题:system

set :rvm_type, :system
于 2013-07-03T19:51:04.497 回答