我是一个新手,所以如果这是一个愚蠢的问题,我很抱歉,但任何人都可以帮我解密这个部署错误?我终于成功地实现了'cap deploy:setup'和'cap deploy:check'运行而没有错误。现在,我被困在'cap deploy:update'中。从错误输出来看,它看起来像我的部署文件存在问题,但我不知道问题可能是什么。下面是shell输出和部署文件。任何帮助将非常感谢!Capistrano部署:更新失败,但设置和检查工作
一些背景:我正在部署到正在运行乘客的朋友的服务器。我们使用的是Ruby 1.9.2-p290,rails 3.1.3,capistrano 2.11.2和MacOS 10.6。
这里的部署错误输出的一个样本:
my-MacBook-Pro:projectfolder myuser$ cap deploy:update
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote ssh://[email protected]/usr/local/git_root/arbiterapi.git master"
*** [deploy:update_code] rolling back
* executing "rm -rf /usr/local/www/sites/project.example.ca/releases/20120330191423; true"
servers: ["project.example.ca"]
[project.example.ca] executing command
[project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'rm -rf /usr/local/www/sites/project.example.ca/releases/20120330191423; true'
command finished in 663ms
/Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:107:in ``': No such file or directory - git ls-remote ssh://[email protected]/usr/local/git_root/project.git master (Errno::ENOENT)
from /Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:107:in `block in run_locally'
from /Users/myuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:106:in `run_locally'
from /Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:44:in `block (3 levels) in load'
from /Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:96:in `with_env'
from /Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:44:in `block (2 levels) in load'
from /Users/myuser/.rvm/gems/[email protected]/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy/scm/git.rb:227:in `query_revision'
... etc.
错误输出指向Capistrano的文件夹中的其余部分为好。输出似乎太长而不能包括在内。但如果它可能有帮助,我可以提供其余部分!
这里的部署文件:
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :application, "Project"
set :scm, "git"
set :repository, "ssh://[email protected]/usr/local/git_root/project.git"
set :user, "deploy"
#set :rvm_bin_path, "/usr/local/rvm/bin"
set :rvm_ruby_string, "[email protected]"
set :normalize_asset_timestamps, false
ssh_options[:forward_agent] = false
set :branch, "master"
set :deploy_via, :remote_cache
set :deploy_to, "/usr/local/www/sites/project.example.ca/"
set :use_sudo, false
set :domain, 'project.example.ca'
role :app, domain
role :web, domain
role :db, domain, :primary => true
感谢您的回复。我删除了ssh前缀,但我得到了同样的“没有这样的文件或目录”错误:没有这样的文件或目录 - git ls-remote [email protected]/usr/local/git_root/arbiterapi.git master( Errno :: ENOENT) – 2012-04-02 15:54:08
'git @ appsrv-04.nullpointer.ca/usr/local/git_root/arbiterapi.git'是否是您的存储库的正确URL?如果是这样,那么你的服务器可能无法访问存储库。假设你可以从你自己的本地机器上push/pull,试着将'ssh_options [:forward_agent]'设为true来代替 – Shaun 2012-04-03 11:45:59
或者,'git ls-remote'可能是一个红色的鲱鱼,实际的问题是目录/usr/local/www/sites/project.example.ca/不存在。 (虽然我不认为这可能) – Shaun 2012-04-03 11:47:03