Search code examples
ruby-on-railscapistranosetup-deployment

Cap deploy asks for password even though ssh key is present in server


When I try to ssh to a server, I'm able to do it as my id_rsa.pub key is added to the authorized keys in the server.

Now when I try to deploy my code via Capistrano to the server from my local project folder, the server asks for a password.

I'm unable to understand what could be the issue if I'm able to ssh and unable to deploy to the same server.

$ cap deploy:setup

"no seed data"
triggering start callbacks for `deploy:setup'
* 13:42:18 == Currently executing `multistage:ensure'
*** Defaulting to `development'
* 13:42:18 == Currently executing `development'
* 13:42:18 == Currently executing `deploy:setup'
triggering before callbacks for `deploy:setup'
* 13:42:18 == Currently executing `db:configure_mongoid'
* executing "mkdir -p /home/deploy/apps/development/flyingbird/shared/config"
 servers: ["dev1.noob.com", "176.9.24.217"]
 Password: 

Solution

  • I got the issue, there was staging.rb, development.rb files which were overriding my cap script credentials whenever tried to deploy the application in different env.