我在将应用程序部署到服务器时遇到问题。
我已经安装并运行了 msysgit、github 和 capistrano。
我已经成功将我的应用推送到github并且可以成功运行
cap deploy:setup
从我的本地计算机在我的服务器上进行设置。
但是..
当我运行 cap deploy:cold
时,它要求我提供连接密码
github repo 然后它再次要求它连接到我的服务器但是然后它
给我一个错误权限被拒绝(公钥)并返回。
这似乎是我的 key 错误,但怎么会呢
连接到我的服务器以执行 cap deplo:setup
?
我的公钥在github和我的服务器上都是一样的 正确的 ?
此外,当运行 cap deploy:setup
时,它会询问我的用户服务器
密码正确吗?
请帮忙,因为这已经耽误了我好几天了
这是错误:
$ 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
非常感谢 rake
最佳答案
如果我将它添加到我的 deploy.rb 文件
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
关于ruby-on-rails - Capistrano问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1176544/