cap部署:冷失败'没有这样的文件或目录 - git rev-parse master'错误 [英] cap deploy:cold fails with 'No such file or directory - git rev-parse master' error
问题描述
服务器运行Ubuntu 10.4服务器(64位)
本地机器是运行Windows XP。
存储库位于github上
我已成功运行
cap deploy:setup
但是当我运行时
cap deploy:cold
我得到以下错误:
D:\Rails\rails_apps\fx> cap deploy:cold
您正在运行Ruby 1.8.6,它的线程实现中存在一个错误。
您可能会遇到运行Capistrano的死锁,除非您安装
fastthread库(可用作宝石):
gem install fastthread
*执行`deploy:cold'
*正在执行`deploy:update'
**事务:启动
*执行`deploy:update_code'
更新所有服务器上的缓存结帐
*** [deploy :update_code]回滚
*执行rm -rf / var / www / fx / releases / 20100818215651; true
servers:[pragmaticriskmanagement.gotdns.com]
[pragmaticriskmanagement。 gotdns.com]执行命令
命令完成
D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37 :在``中:没有这样的文件或目录 - 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/cap istrano-2.1.0 / lib / capistrano / recipes / deploy.rb:87:在with_env'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/ lib / capistrano / recipes / deploy.rb:37:`load'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistran/recipes/部署/ scm / git.rb:154:在`query_revision'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/ scm / base.rb:35:在`发送'
从D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/ base.rb:35:从`method_missing'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base。 rb:63:在本地
从D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb: 35:在`method_missing'
... 39个关卡中......
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/ CLI / E xecute.rb:14:在`执行'中从$ D $ / b $ b /Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/bin/cap:4
从D: / Rails / ruby / bin / cap:19:在`load'
从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#确保git子模块已经被填充
set:location,pragmaticriskmanagement.gotdns.com
set:user, xxxxx
set:use_sudo,false
$ b $ set:scm,:git
角色:应用程序,位置#您的应用程序服务器在这里
角色:web,location#你的web服务器在这里
角色:db,location,:primary => true#你的db-server here,:primary => true
命名空间:deploy do
desc重新启动应用程序
task:restart,:roles => :app do
运行touch#{current_path} /tmp/restart.txt
结束
desc制作database.yml的符号链接
任务:symlink_dbyaml做
运行ln -nfs#{shared_path} /config/database.yml#{release_path} /config/database.yml
end
desc创建空数据库。 yml in shared path
task:create_dbyaml do
runmkdir -p#{shared_path} / config
put'',#{shared_path} /config/database.yml$ 'deploy:update_code','deploy:symlink_dbyaml'
$'deploy:'后,b: 部署,部署:清理之后的b
$ b
现在我卡住了.. 。
任何帮助将不胜感激。
感谢,
Jon
好吧,我已经取得了一些进展。
看起来错误表明在本地系统(win xp)上找不到git ls-remote命令。作为测试,我打开了GIT Bash shell并尝试了命令 - 它工作正常。接下来,我尝试了
cap deploy
来自GIT Bash shell。找不到命令。好的,我添加了我的导轨路径
D:\Rails\ruby\bin
blockquote>
添加到windows'path'变量中。现在,尝试
cap deploy
$ b $来自bash shell的b
。这似乎解决了这个问题,现在导致我的下一个问题
** [xxxxxxxx.com :: out]克隆到/ var / www / fx / shared / cached-copy ...
** [xxxxxxxx.com :: err] Permission denied(publickey)。
** [xxxxxxxx.com :: err]致命:远端意外挂断
我可以使用相同的公钥成功运行我的linux系统中的cap deploy。另外,我可以用这个键从这款笔记本电脑上推送到我的Github回购。当然,问题的关键应该在服务器上,但是如果它运行时,我从linux机器运行'cap',为什么它不能从这里运行?
I am trying to deploy my rails application for the first time.
Server is running Ubuntu 10.4 server (64bit)
Local machine is running Windows XP.
Repository is at githubI have successfully run
cap deploy:setup
but when I run
cap deploy:cold
I get the following error:
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
Here is my 'deploy.rb' file
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"
and now I'm stuck...
Any help would be greatly appreciated.
Thanks,
Jon解决方案Ok, I have made some progress.
It seems that the error indicates that the git ls-remote command could not be found on the local system (win xp). As a test, I opened the GIT Bash shell and tried the command - it worked. Next, I tried
cap deploy
from the GIT Bash shell. Command not found. OK, I added my rails path
D:\Rails\ruby\bin
to the windows 'path' variable. Now, try
cap deploy
from the bash shell. This seems to have solved this problem, which now leads to my next problem
** [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
I can successfully run cap deploy from my linux box with the same public key. Also, I can push to my Github repo from this laptop with this key. Of course, the key in question should be on the server, but if it works when I run 'cap' from the linux box, why wouldn't it run from here?
这篇关于cap部署:冷失败'没有这样的文件或目录 - git rev-parse master'错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!