2012-03-30 70 views
1

我是一個新手,所以如果這是一個愚蠢的問題,我很抱歉,但任何人都可以幫我解密這個部署錯誤?我終於成功地實現了'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 

回答

0

的錯誤是行

No such file or directory - git ls-remote ssh://[email protected]/usr/local/git_root/project.git master (Errno::ENOENT) 

所以未能在結賬出庫。爲什麼你有ssh前綴?當指定用戶([email protected]),你不應該有一個協議,以及 - 庫應該只設置爲

[email protected]/usr/local/git_root/project.git 

或任何實際的URL是爲項目的Git倉庫。

僅供參考 - 既沒有deploy:setup也沒有deploy:check實際檢出代碼,這就是爲什麼這兩個工作。

+0

感謝您的回覆。我刪除了ssh前綴,但我得到了同樣的「沒有這樣的文件或目錄」錯誤:沒有這樣的文件或目錄 - git ls-remote [email protected]/usr/local/git_root/arbiterapi.git master( Errno :: ENOENT) – 2012-04-02 15:54:08

+0

'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

+0

或者,'git ls-remote'可能是一個紅色的鯡魚,實際的問題是目錄/usr/local/www/sites/project.example.ca/不存在。 (雖然我不認爲這可能) – Shaun 2012-04-03 11:47:03