git version 1.6.4.2CAPIstrano v2.5.10
基本上,当我运行我的cap deploy.rb脚本时,它连接到服务器,开始执行deploy:update任务,然后在deploy:update_code任务中:
*** [deploy:update_code] rolling back * executing "rm -rf /home/user_name/public_HTML/project_name/releases/20091223094358; true" servers: ["project_name.com"]
它失败并出现以下错误:
/library/Ruby/Gems/1.8/gems/cAPIstrano-2.5.10/lib/cAPIstrano/recipes/deploy/scm/git.rb:231:in `query_revision': Unable to resolve revision for 'master' on repository 'ssh://git@slice_ip:path_to_git_repository'. (RuntimeError)
这是我的部署脚本,我尝试过包含和省略:
设置:分支’主’
我也只是认为我的存储库路径已经关闭,但我已经尝试了几乎所有的排列(绝对的,不是绝对的,.git后缀,没有后缀).在我指向的路径上肯定有一个简单的git存储库.
**我确实在一个片上托管了多个项目.其他项目也是一个rails项目,但正在运行SVN. CAPIstrano部署工作正常.
如果我无法弄明白这一点,任何指示正确的方向或任何想法将有助于减少我计划做的饮酒量. (路径/ IP混淆,不要破坏我兄弟!)
set :application,"project1"set :user,"username"set :repository,"ssh://[email protected]/home/git/project1.git"set :branch,"master" set :port,696969set :deploy_to,"/home/username/public_HTML/#{application}"set :scm,:gitrole :app,application role :web,application role :db,application,:primary => true # deployment via remote clIEnt (workstation)set :deploy_via,:copy set :runner,user# mod_railsnamespace :deploy do desc "Restarting mod_rails with restart.txt" task :restart,:roles => :app,:except => { :no_release => true } do run "touch #{current_path}/tmp/restart.txt" end [:start,:stop].each do |t| desc "#{t} task is a no-op with mod_rails" task t,:roles => :app do ; end endend
这是最相关的帖子(甚至非常相关),但我无法弄清楚他们说的修复是什么.我对git / cAPIstrano配置很新.
https://capistrano.lighthouseapp.com/projects/8716/tickets/56-query_revision-unable-to-resolve-revision-for-head-on-repository
解决方法 好吧,我好像修好了.基本上,由于我在远程服务器上有2个独立的存储库,我认为“git”用户失败了,因为我没有为git用户注册ssh密钥对.这就解释了为什么我的一个deploy.rb脚本工作正常,而这个脚本没有.
在我在问题中发布的链接中,其中一位评论者指出了这个问题:
https://capistrano.lighthouseapp.com/projects/8716/tickets/56-query%5Frevision-unable-to-resolve-revision-for-head-on-repository
Note this error is also displayed if
you are using multiple github keys per
07001….
and you do not have these keys and a
corresponding entry in your
.ssh/config on the workstation you’re
running the deploy from. so the
ls-remote is run locally. is there a
way to reference the repository at
github.com for this request while the
remote deploy uses
git@github-project1:user/project1.git
另外,请参阅以下链接以获取更多详细信息,因为即使您不使用github,整个ssh问题也会适用.
http://github.com/guides/multiple-github-accounts
总结以上是内存溢出为你收集整理的ruby-on-rails – Capistrano和Git,毁了我的生命. “无法解决存储库中[HEAD]的修订…”全部内容,希望文章能够帮你解决ruby-on-rails – Capistrano和Git,毁了我的生命. “无法解决存储库中[HEAD]的修订…”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)