1

我在部署 capistrano 时遇到了一些问题。

据我所知,失败是使用 git ls-remote 命令发生的,但是当我在服务器上手动运行它时,它会成功返回。

任何帮助将不胜感激!


解决了

安装山狮后,我的 git cli 无法正常工作。


cap deploy
    triggering load callbacks
  * 15:55:49 == Currently executing `staging'
    triggering start callbacks for `deploy'
  * 15:55:49 == Currently executing `multistage:ensure'
  * 15:55:49 == Currently executing `deploy'
  * 15:55:49 == Currently executing `deploy:update'
 ** transaction: start
  * 15:55:49 == Currently executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@github.com:taheilo/taheilo.com.git master"
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/frankie/sites/taheilo.com/stage/releases/20120726135550; true"
    servers: ["198.101.205.147"]
    [198.101.205.147] executing command
    command finished in 2039ms
/Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:107:in ``': No such file or directory - git ls-remote git@github.com:taheilo/taheilo.com.git master (Errno::ENOENT)
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:107:in `block in run_locally'
  from /Users/frankie/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:106:in `run_locally'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:44:in `block (3 levels) in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:96:in `with_env'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:44:in `block (2 levels) in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/scm/git.rb:227:in `query_revision'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `block in method_missing'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:44:in `block in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/variables.rb:87:in `call'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/variables.rb:87:in `block in fetch'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/variables.rb:110:in `block in protect'
  from <internal:prelude>:10:in `synchronize'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/variables.rb:110:in `protect'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/variables.rb:78:in `fetch'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/variables.rb:95:in `[]'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/strategy/base.rb:82:in `revision'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:35:in `update_repository_cache'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:15:in `deploy!'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:222:in `block (2 levels) in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:89:in `execute_task'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/namespaces.rb:193:in `method_missing'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:203:in `block (3 levels) in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:56:in `transaction'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/namespaces.rb:193:in `method_missing'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:202:in `block (2 levels) in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:89:in `execute_task'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/namespaces.rb:193:in `method_missing'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/recipes/deploy.rb:170:in `block (2 levels) in load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:89:in `execute_task'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:45:in `each'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:34:in `execute!'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:14:in `execute'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/gems/capistrano-2.12.0/bin/cap:4:in `<top (required)>'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/bin/cap:19:in `load'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/bin/cap:19:in `<main>'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
  from /Users/frankie/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
4

1 回答 1

1

正如 capistrano 所说,您应该尝试在本地执行它:

executing locally: "git ls-remote git@github.com:taheilo/taheilo.com.git master"
于 2012-07-26T14:05:45.130 回答