I am having a problem with deploying my application to my server.
I have msysgit, github and capistrano installed and working.
I have successfully pushed my app to github and can successfully run
cap deploy:setup
to setup on my server from my local machine.
BUT..
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.
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
?
My public keys are the same in both github and my server is this correct ?
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
This is the error:
$ 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
Thanks alot rick
If I add this to my deploy.rb file
I get this different error
This question is really old, but I just encountered the same problem again on a windows 7 machine. You should add forward_agent and the location of your ssh key to your deploy config file: Here is my fix at config/deploy.rb:
Besides that, the best solution would be to develop rails applications (and to use capistrano) in a linux environment. This would avoid tons of such tricks, wordrounds and it would save plenty of time :)
You should have on your server (where you want deploy) installed yours access keys for git server.
You should have yours key files (with chmod 600):
in ~/.ssh directory (with chmod 700) on server in deploy user home
you probably have that keys only on your local development computer.
You can add for your deploy file hook for 'setup:cold' where will be automated upload of your local keys files.
It's not needed to have the ssh keys to access the repository server on the deploy mahcine. You can activate the SSH forward_agent, to make the ssh_agent follow you from machine to mache. To do this with capistrano, you can add this line to the deploy.rb file