部署网站的时候老有这个 rvm path 的问题
>cap deploy:cold
triggering load callbacks
* 2013-11-06 17:44:09 executing `deploy'
triggering before callbacks for `deploy'
* 2013-11-06 17:44:09 executing `rvm:install_rvm'
* executing "__LAST_STATUS=0; export CURL_HOME=\"${TMPDIR:-${HOME}}/.rvm-curl-config.$$\"; mkdir ${CURL_HOME}/; { [[ -r ${HOME}/.curlrc ]] && cat ${HOME}/.curlrc; echo \"silent\"; echo \"show-error\"; } > $CURL_HOME/.curlrc; curl -L https://get.rvm.io | bash -s stable --path $HOME/.rvm || __LAST_STATUS=$?; rm -rf $CURL_HOME; exit ${__LAST_STATUS}"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
** [out :: 162.243.xx.187] Downloading RVM branch stable
** [out :: 162.243.xx.187] Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz to rvm-stable.tgz.
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] Upgrading the RVM installation in /home/william/.rvm/
** [out :: 162.243.xx.187] RVM PATH line found in /home/william/.bashrc /home/william/.zshrc.
** [out :: 162.243.xx.187] RVM sourci$1}$2ng line found in /home/william/.bash_profile /home/william/.zlogin.
** [out :: 162.243.xx.187] Upgrade of RVM in /home/william/.rvm/ is complete.
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] # william,
** [out :: 162.243.xx.187] #
** [out :: 162.243.xx.187] # Thank you for using RVM!
** [out :: 162.243.xx.187] # We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
** [out :: 162.243.xx.187] #
** [out :: 162.243.xx.187] # ~Wayne, Michal & team.
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] In case of problems: http://rvm.io/help
** [out :: 162.243.xx.187] Help RVM 2.0: https://www.bountysource.com/fundraisers/489-rvm-2-0
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] Upgrade Notes:
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] * No new notes to display.
** [out :: 162.243.xx.187]
command finished in 3337ms
* 2013-11-06 17:44:15 executing `rvm:install_ruby'
* executing "__LAST_STATUS=0; export CURL_HOME=\"${TMPDIR:-${HOME}}/.rvm-curl-config.$$\"; mkdir ${CURL_HOME}/; { [[ -r ${HOME}/.curlrc ]] && cat ${HOME}/.curlrc; echo \"silent\"; echo \"show-error\"; } > $CURL_HOME/.curlrc; $HOME/.rvm/bin/rvm --autolibs=2 install ruby-2.0.0-p247 || __LAST_STATUS=$?; rm -rf $CURL_HOME; exit ${__LAST_STATUS}"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
** [out :: 162.243.xx.187] Already installed ruby-2.0.0-p247.
** [out :: 162.243.xx.187] To reinstall use:
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] rvm reinstall ruby-2.0.0-p247
** [out :: 162.243.xx.187]
command finished in 1319ms
* 2013-11-06 17:44:17 executing `rvm:create_alias'
* executing "$HOME/.rvm/bin/rvm alias create clinic ruby-2.0.0-p247"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
** [out :: 162.243.xx.187] Creating alias clinic for ruby-2.0.0-p247.
** [out :: 162.243.xx.187] Recording alias clinic for ruby-2.0.0-p247.
command finished in 1461ms
* 2013-11-06 17:44:18 executing `rvm:create_wrappers'
* executing "$HOME/.rvm/bin/rvm wrapper ruby-2.0.0-p247 --no-prefix --all"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
** [out :: 162.243.xx.187] Saving wrappers to '/home/william/.rvm/bin'.
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187] .
** [out :: 162.243.xx.187]
command finished in 1793ms
* 2013-11-06 17:44:20 executing `deploy:update'
** transaction: start
* 2013-11-06 17:44:20 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]:whu/clinic.git master"
command finished in 4283ms
* executing "if [ -d /home/william/apps/clinic/shared/cached-copy ]; then cd /home/william/apps/clinic/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 030b85f1e20508d615d940cb75749604644a1d37 && git clean -q -d -x -f; else git clone -q -b master [email protected]:whu/clinic.git /home/william/apps/clinic/shared/cached-copy && cd /home/william/apps/clinic/shared/cached-copy && git checkout -q -b deploy 030b85f1e20508d615d940cb75749604644a1d37; fi"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
command finished in 3391ms
copying the cached version to /home/william/apps/clinic/releases/20131106094427
* executing "cp -RPp /home/william/apps/clinic/shared/cached-copy /home/william/apps/clinic/releases/20131106094427 && (echo 030b85f1e20508d615d940cb75749604644a1d37 > /home/william/apps/clinic/releases/20131106094427/REVISION)"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
command finished in 1376ms
* 2013-11-06 17:44:29 executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* 2013-11-06 17:44:29 executing `bundle:install'
* executing "cd /home/william/apps/clinic/releases/20131106094427 && bundle install --gemfile /home/william/apps/clinic/releases/20131106094427/Gemfile --path /home/william/apps/clinic/shared/bundle --deployment --quiet --without development test"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
** [out :: 162.243.xx.187] You are trying to install in deployment mode after changing
** [out :: 162.243.xx.187] your Gemfile. Run `bundle install` elsewhere and add the
** [out :: 162.243.xx.187] updated Gemfile.lock to version control.
** [out :: 162.243.xx.187]
** [out :: 162.243.xx.187] You have added to the Gemfile:
** [out :: 162.243.xx.187] * therubyracer
** [out :: 162.243.xx.187] * rvm-capistrano
command finished in 1627ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/william/apps/clinic/releases/20131106094427; true"
servers: ["162.243.xx.187"]
[162.243.xx.187] executing command
command finished in 1287ms
failed: "rvm_path=$HOME/.rvm $HOME/.rvm/bin/rvm-shell 'ruby-2.0.0-p247' -c 'cd /home/william/apps/clinic/releases/20131106094427 && bundle install --gemfile /home/william/apps/clinic/releases/20131106094427/Gemfile --path /home/william/apps/clinic/shared/bundle --deployment --quiet --without development test'" on 162.243.xx.187
但是我看这句 executing "rm -rf /home/william/apps/xxx/releases/20131106094427; true" 已经删除了 20131106094427 是不是 cd /home/william/apps/xxx/releases/20131106094427 这句发生了错误呢?
新手求指点!!
PS: deploy.rb
require "bundler/capistrano"
require "rvm/capistrano"
require "rvm/capistrano/alias_and_wrapp"
require 'capistrano-unicorn'
require "capistrano-file_db"
load 'deploy/assets'
set :scm, :git
set :branch, "master"
set :repository, "[email protected]:xxx/xxx.git"
#set :keep_releases, 5
set :application, "clinic"
set :user, "william"
set :port, 22
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :rails_env, "production"
set :normalize_asset_timestamps, false #for Solve the probem: Not precomplie assets
role :web, "xxx.xxx.xxx.xxx" # Your HTTP server, Apache/etc
role :app, "xxx.xxx.xxx.xxx" # This may be the same as your `Web` server
role :db, "xxx.xxx.xxx.xxx", :primary => true # This is where Rails migrations will run
set :rvm_ruby_string, :local
set :unicorn_pid, "#{shared_path}/pids/unicorn.pid"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
before 'deploy:restart', 'deploy:migrate'
before 'deploy', 'rvm:install_rvm'
before 'deploy', 'rvm:install_ruby'
before 'deploy', 'rvm:create_alias'
before 'deploy', 'rvm:create_wrappers'
after 'deploy', 'deploy:cleanup'