capistrano问题 [英] capistrano problem

查看:143
本文介绍了capistrano问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将应用程序部署到我的服务器时遇到问题。

I am having a problem with deploying my application to my server.

我有msysgit,github和capistrano安装和工作。

I have msysgit, github and capistrano installed and working.

我已成功将我的应用推送到github,并可以成功运行
cap deploy:setup 来设置在我的本地机器的服务器上。

I have successfully pushed my app to github and can successfully run cap deploy:setup to setup on my server from my local machine.

但是...

当我运行 cap deploy:cold 它询问我的密码以连接到
github repo然后它再次请求连接到我的服务器,但是然后它
给我一个错误权限被拒绝(公钥)和滚动回来。

When I run cap deploy:cold it asks me for my passphrase to connect to github repo then it asks it again to connect to my server but then it gives me an error permission denied (public key) and rools back.

似乎这是我的密钥错误,但是如何才能
连接到我的服务器来执行 cap deplo:设置

It seems like this is an error with my keys but how can it then connect to my server to do the cap deplo:setup ?

我的公钥在github中是相同的,而我的服务器是这个
正确吗?

My public keys are the same in both github and my server is this correct ?

同时运行 cap deploy:setup 它会询问我的用户服务器
密码是否正确?

Also when running cap deploy:setup it asks me for my user server password is this correct ?

请帮助,因为这已经延迟了我的日子了

Please help as this has delayed me for days already

这是错误:

$ cap deploy * executing deploy' * executing deploy:update' ** 
transaction: start * executing `deploy:update_code' executing locally: 
"git ls-remote g...@github.com:rmossuk/Macrotec.git master " 
Enter passphrase for key '/c/Users/Rick/.ssh/id_rsa': * 
executing "git clone -q g...@github.com:rmossuk/Macrotec.git /usr/local/lib/r uby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Macrotec/releases/20090723213346 && cd /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/ra ils_apps/Macrotec/releases/20090723213346 && git checkout -q -b deploy a28798bc0 d3b5688453a58bf4917d6c931187a7a && (echo a28798bc0d3b5688453a58bf4917d6c931187a7 a > /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Mac rotec/releases/20090723213346/REVISION)" servers: ["macclesfieldnutrition.co.uk"] 
Enter passphrase for c:/Users/Rick/.ssh/id_rsa: 
[macclesfieldnutrition.co.uk] executing command ** 
[macclesfieldnutrition.co.uk :: out] Permission denied (publickey). ** 
[macclesfieldnutrition.co.uk :: out] fatal: The remote end hung up 
unexpecte dly command finished *** [deploy:update_code] rolling back * 
executing "rm -rf /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/s tub/rails_apps/Macrotec/releases/20090723213346; true" 
servers: 
["macclesfieldnutrition.co.uk"] [macclesfieldnutrition.co.uk] 
executing command command finished failed: "sh -c 'git clone -q g...@github.com:rmossuk/Macrotec.git /usr/local/lib/ ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Macrotec/releases/20090723213346 && cd /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/r ails_apps/Macrotec/releases/20090723213346 && git checkout -q -b deploy a28798bc 0d3b5688453a58bf4917d6c931187a7a && (echo a28798bc0d3b5688453a58bf4917d6c931187a 7a > /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Ma crotec/releases/20090723213346/REVISION)'" on macclesfieldnutrition.co.uk 

感谢alot rick

Thanks alot rick

推荐答案

如果我将其添加到我的deploy.rb文件

If I add this to my deploy.rb file

set :ssh_options, {:forward_agent => true}
on :start do    
  `ssh-add`
end

我得到这个不同的错误

$ cap deploy
    triggering start callbacks for `deploy'
Could not open a connection to your authentication agent.
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "git ls-remote git@github.com:rmossuk/Macrotec.git master
"
Enter passphrase for key '/c/Users/Rick/.ssh/id_rsa':
  * executing "git clone -q git@github.com:rmossuk/Macrotec.git /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Macrotec/releases/20090724112629 && cd /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Macrotec/releases/20090724112629 && git checkout -q -b deploy a28798bc0d3b5688453a58bf4917d6c931187a7a && (echo a28798bc0d3b5688453a58bf4917d6c931187a7a > /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Macrotec/releases/20090724112629/REVISION)"
    servers: ["macclesfieldnutrition.co.uk"]
Enter passphrase for c:/Users/Rick/.ssh/id_rsa:
    [macclesfieldnutrition.co.uk] executing command
*** [deploy:update_code] rolling back
  * executing "rm -rf /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.4/test/stub/rails_apps/Macrotec/releases/20090724112629; true"
    servers: ["macclesfieldnutrition.co.uk"]
 ** [deploy:update_code] exception while rolling back: TypeError, can't convert
Net::SSH::Authentication::Pageant::Socket into IO
c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/processable.rb:25:in `select': can't convert Net::SSH::Authentication::Pageant::Socket into IO (TypeError)
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/processable.rb:25:in `process_iteration'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/command.rb:163:in `process!'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/command.rb:162:in `loop'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/command.rb:162:in `process!'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/command.rb:133:in `process'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb:173:in `run_tree'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/connections.rb:172:in `execute_on_servers'
        from c:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `each_slice'
         ... 40 levels...
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/execute.rb:14:in `execute'
        from c:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.8/bin/cap:4
        from c:/InstantRails/ruby/bin/cap:19:in `load'
        from c:/InstantRails/ruby/bin/cap:19

这篇关于capistrano问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆