connection failed for: localhost (Errno::ECONNREFU

2019-06-13 18:58发布

问题:

I am using capistrano 2.15.5 for my rails application deployment. I am using localhost for server and have also tried with 127.0.0.1 in place of localhost. After running *cap production deploy:setup* the error that i am getting is: **Errno::ECONNREFUSED: Connection refused - connect(2)**. After searching for it i found out ECONNREFUSED means the client couldn't make a TCP connection to the server, either because it's down, or its DNS is not resolving..

how to fix this issue? thanks.

回答1:

You have to add your ssh key in server's ssh authorize keys