Capistrano 3没有执行任务

时间:2014-09-16 21:08:46

标签: ruby task capistrano3

MacBook-Pro:myapp deploy_user$ cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Execute rvm:hook
DEBUG[46b09934] Running /usr/bin/env [ -d ~/.rvm ] on xxx.xxx.xxx.xxx
DEBUG[46b09934] Command: [ -d ~/.rvm ]
DEBUG[46b09934] Finished in 10.358 seconds with exit status 1 (failed).
DEBUG[1e7908b8] Running /usr/bin/env [ -d /usr/local/rvm ] on xxx.xxx.xxx.xxx
DEBUG[1e7908b8] Command: [ -d /usr/local/rvm ]
DEBUG[1e7908b8] Finished in 0.104 seconds with exit status 0 (successful).
** Invoke rvm:check (first_time)
** Execute rvm:check
DEBUG[898c87bd] Running /usr/local/rvm/bin/rvm version on xxx.xxx.xxx.xxx
DEBUG[898c87bd] Command: /usr/local/rvm/bin/rvm version
DEBUG[898c87bd]     
DEBUG[898c87bd]     rvm 1.16.20 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG[898c87bd]     
DEBUG[898c87bd] Finished in 0.281 seconds with exit status 0 (successful).
rvm 1.16.20 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG[00cdd953] Running /usr/local/rvm/bin/rvm current on xxx.xxx.xxx.xxx
DEBUG[00cdd953] Command: /usr/local/rvm/bin/rvm current
DEBUG[00cdd953]     ruby-1.9.3-p327
DEBUG[00cdd953] Finished in 0.327 seconds with exit status 0 (successful).
ruby-1.9.3-p327
DEBUG[6fe94e20] Running /usr/local/rvm/bin/rvm default do ruby --version on xxx.xxx.xxx.xxx
DEBUG[6fe94e20] Command: /usr/local/rvm/bin/rvm default do ruby --version
DEBUG[6fe94e20]     ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
DEBUG[6fe94e20] Finished in 0.685 seconds with exit status 0 (successful).
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env 
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
** Execute git:check
** Invoke deploy:check:directories (first_time)
** Execute deploy:check:directories
** Invoke deploy:check:linked_dirs (first_time)
** Execute deploy:check:linked_dirs
** Invoke deploy:check:make_linked_dirs (first_time)
** Execute deploy:check:make_linked_dirs
** Invoke deploy:check:linked_files (first_time)
** Execute deploy:check:linked_files
** Invoke deploy:set_previous_revision (first_time)
** Execute deploy:set_previous_revision
** Invoke deploy:started (first_time)
** Execute deploy:started
** Invoke deploy:updating (first_time)
** Invoke deploy:new_release_path (first_time)
** Execute deploy:new_release_path
** Execute deploy:updating
** Invoke git:create_release (first_time)
** Invoke git:update (first_time)
** Invoke git:clone (first_time)
** Invoke git:wrapper 
** Execute git:clone
** Execute git:update
** Execute git:create_release
** Invoke deploy:set_current_revision (first_time)
** Execute deploy:set_current_revision
** Invoke git:set_current_revision (first_time)
** Execute git:set_current_revision
** Invoke deploy:symlink:shared (first_time)
** Execute deploy:symlink:shared
** Invoke deploy:symlink:linked_files (first_time)
** Execute deploy:symlink:linked_files
** Invoke deploy:symlink:linked_dirs (first_time)
** Execute deploy:symlink:linked_dirs
** Invoke deploy:updated (first_time)
** Invoke bundler:install (first_time)
** Execute bundler:install
** Execute deploy:updated
** Invoke deploy:compile_assets (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:compile_assets
** Invoke deploy:assets:precompile (first_time)
** Execute deploy:assets:precompile
DEBUG[1678fefe] Running /usr/bin/env if test ! -d /var/webapps/myapp/releases/20140916205923; then echo "Directory does not exist '/var/webapps/myapp/releases/20140916205923'" 1>&2; false; fi on xxx.xxx.xxx.xxx
DEBUG[1678fefe] Command: if test ! -d /var/webapps/myapp/releases/20140916205923; then echo "Directory does not exist '/var/webapps/myapp/releases/20140916205923'" 1>&2; false; fi
DEBUG[1678fefe]     Directory does not exist '/var/webapps/myapp/releases/20140916205923'
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xxx: if test ! -d /var/webapps/myapp/releases/20140916205923; then echo "Directory does not exist '/var/webapps/myapp/releases/20140916205923'" 1>&2; false; fi exit status: 1
if test ! -d /var/webapps/myapp/releases/20140916205923; then echo "Directory does not exist '/var/webapps/myapp/releases/20140916205923'" 1>&2; false; fi stdout: Nothing written
if test ! -d /var/webapps/myapp/releases/20140916205923; then echo "Directory does not exist '/var/webapps/myapp/releases/20140916205923'" 1>&2; false; fi stderr: Directory does not exist '/var/webapps/myapp/releases/20140916205923'

看来是这样,没有执行任务。我删除了所有Capistrano2的东西。之后用软件包安装了Capistrano3。

安装了以下宝石并进行了更新:

group :development do
  gem 'capistrano'
  gem 'capistrano-rails'
  gem 'capistrano-rvm', require: false
  #gem 'capistrano-rbenv', require: false
  #gem 'capistrano-chruby', github: 'capistrano/chruby', require: false
end

任何想法为什么?我不知道在哪里寻找这个问题。

1 个答案:

答案 0 :(得分:0)

我认为你需要运行:

cap deploy:setup

或者

cap production deploy:setup

在您的服务器上创建/ var / webapps / myapp / releases。使用以下命令检查部署:

 cap deploy:check