Capistrano部署不完整

时间:2012-02-04 06:55:41

标签: ruby-on-rails capistrano

我想使用Capistrano将本地应用程序部署到生产服务器。然而事情失败了,我不知道如何解决它。好消息是/shared/cached-copy完全在远程服务器上创建。如何解决rsync错误?

cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@bitbucket.org:foo/bar.git HEAD"
  * executing "if [ -d /path/foo/shared/cached-copy ]; then cd /path/foo/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard e216d5f840f3d78458a3734a3830a4030750c85c && git clean -q -d -x -f; else git clone -q git@bitbucket.org:foo/bar.git /path/foo/shared/cached-copy && cd /path/foo/shared/cached-copy && git checkout -q -b deploy e216d5f840f3d78458a3734a3830a4030750c85c; fi"
    servers: ["foo.com"]
    [foo.com] executing command
    command finished in 33589ms
    copying the cached version to /path/foo/releases/20120204063129
  * executing "rsync -lrpt --exclude=\".git\" --exclude=\".DS_Store\" --exclude=\".gitignore\" --exclude=\".gitmodules\" /path/foo/shared/cached-copy/ /path/foo/releases/20120204063129 && (echo e216d5f840f3d78458a3734a3830a4030750c85c > /path/foo/releases/20120204063129/REVISION)"
    servers: ["foo.com"]
    [foo.com] executing command
*** [err :: foo.com] rsync: mkdir "/path/foo/releases/20120204063129" failed: No such file or directory (2)
*** [err :: foo.com] rsync error: error in file IO (code 11) at main.c(587) [Receiver=3.0.8]
*** [err :: foo.com] rsync: connection unexpectedly closed (9 bytes received so far) [sender]
*** [err :: foo.com] rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.8]
    command finished in 899ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /path/foo/releases/20120204063129; true"
    servers: ["foo.com"]
    [foo.com] executing command
    command finished in 841ms
failed: "sh -c 'rsync -lrpt --exclude=\".git\" --exclude=\".DS_Store\" --exclude=\".gitignore\" --exclude=\".gitmodules\" /path/foo/shared/cached-copy/ /path/foo/releases/20120204063129 && (echo e216d5f840f3d78458a3734a3830a4030750c85c > /path/foo/releases/20120204063129/REVISION)'" on foo.com

我的deploy.rb文件:

set :application, "FooBar"
set :repository, "git@bitbucket.org:foo/bar.git"
set :scm, :git
set :deploy_to, "/path/foo"
set :deploy_via, :remote_cache
set :copy_exclude, [".git", ".DS_Store", ".gitignore", ".gitmodules"]
set :user, "foobar"
server "foobar.tdl", :app
ssh_options[:forward_agent] = true

1 个答案:

答案 0 :(得分:3)

看起来您的第一个错误是:

*** [err :: foo.com] rsync: mkdir "/path/foo/releases/20120204063129" failed: No such file or directory (2)

服务器上是否已存在/path/foo/releases目录?尝试创建它。