cap部署:冷失败'没有这样的文件或目录 – git rev-parse master'错误

我正在尝试第一次部署我的rails应用程序。

服务器运行Ubuntu 10.4服务器(64位)
本地机器正在运行Windows XP。
版本库在github

我已经成功运行了

cap deploy:setup 

但是当我跑步

 cap deploy:cold 

我得到以下错误:

 D:\Rails\rails_apps\fx>cap deploy:cold You are running Ruby 1.8.6, which has a bug in its threading implementation. You are liable to encounter deadlocks running Capistrano, unless you install the fastthread library, which is available as a gem: gem install fastthread * executing `deploy:cold' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' updating the cached checkout on all servers *** [deploy:update_code] rolling back * executing "rm -rf /var/www/fx/releases/20100818215651; true" servers: ["pragmaticriskmanagement.gotdns.com"] [pragmaticriskmanagement.gotdns.com] executing command command finished D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37:in ``': No such file or directory - git rev-parse master (Errno::ENOENT) from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37:in `load' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:87:in `with_env' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37:in `load' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistran/recipes/deploy/scm/git.rb:154:in `query_revision' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `send' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing' ... 39 levels... from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/cli/execute.rb:14:in `execute' from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/bin/cap:4 from D:/Rails/ruby/bin/cap:19:in `load' from D:/Rails/ruby/bin/cap:19 

这是我的'deploy.rb'文件

 set :application, "fx" #"pragmaticriskmanagement.gotdns.com" set :repository, "git@github.com:jmedding/Fx.git" set :deploy_to, "/var/www/#{application}" set :git_enable_submodules, 1 # Make sure git submodules are populated set :location, "pragmaticriskmanagement.gotdns.com" set :user, "xxxxx" set :use_sudo, false set :scm, :git role :app, location #"your app-server here" role :web, location #"your web-server here" role :db, location, :primary => true #"your db-server here", :primary => true namespace :deploy do desc "Restart Application" task :restart, :roles => :app do run "touch #{current_path}/tmp/restart.txt" end desc "Make symlink for database.yml" task :symlink_dbyaml do run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" end desc "Create empty database.yml in shared path" task :create_dbyaml do run "mkdir -p #{shared_path}/config" put '', "#{shared_path}/config/database.yml" end end after 'deploy:setup', 'deploy:create_dbyaml' after 'deploy:update_code', 'deploy:symlink_dbyaml' after "deploy", "deploy:cleanup" 

现在我卡住了…

任何帮助将不胜感激。

谢谢,
乔恩

对不起,以恢复这样一个旧的线程,但我解决了这个问题,我的git二进制文件(C:\ Program Files文件(x86)\ Git \ bin)的默认位置添加到我的PATH变量。

好的,我已经取得了一些进展。

看来这个错误表明在本地系统(win xp)上找不到git ls-remote命令。 作为一个测试,我打开了Git Bash shell并尝试了命令 – 它工作。 接下来,我试了一下

 cap deploy 

从GIT Bash shell。 找不到命令。 好的,我添加了我的导轨路径

d:\ Rails的\红宝石\ BIN

到窗口的“路径”变量。 现在,尝试

 cap deploy 

从bash外壳。 这似乎解决了这个问题,现在导致我的下一个问题

 ** [xxxxxxxx.com :: out] Cloning into /var/www/fx/shared/cached-copy... ** [xxxxxxxx.com :: err] Permission denied (publickey). ** [xxxxxxxx.com :: err] fatal: The remote end hung up unexpectedly 

我可以使用相同的公钥从我的linux系统中成功运行cap部署。 另外,我可以用这个键从这个笔记本电脑上推到我的Github回购。 当然,问题的关键应该在服务器上,但是如果它运行在我从linux机器运行“cap”的时候,为什么不从这里运行呢?