我在将应用程序部署到服务器时遇到问题。
我已经安装并运行了 msysgit、github 和 capistrano。
我已成功将我的应用程序推送到 github,并且可以
cap deploy:setup
从我的本地计算机成功运行以在我的服务器上进行设置。
但..
当我运行cap deploy:cold
它时,它要求我输入密码以连接到 github 存储库,然后它再次要求它连接到我的服务器,但随后它给了我一个错误权限被拒绝(公钥)并返回。
似乎这是我的密钥错误,但它如何连接到我的服务器来执行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
非常感谢瑞克