连接失败:本地主机(Errno :: ECONNREFUSED:连接被拒绝-connect(2)) [英] connection failed for: localhost (Errno::ECONNREFUSED: Connection refused - connect(2))

查看:191
本文介绍了连接失败:本地主机(Errno :: ECONNREFUSED:连接被拒绝-connect(2))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将capistrano 2.15.5用于我的Rails应用程序部署。我正在将localhost用于服务器,并且还尝试使用127.0.0.1代替localhost。 运行* cap production deploy:setup *后,我得到的错误是:** Errno :: ECONNREFUSED:连接被拒绝-connect(2)**。
搜索后,我发现 ECONNREFUSED表示客户端无法建立与服务器的TCP连接,原因可能是服务器已关闭或DNS无法解析。

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.

推荐答案

您必须在服务器的ssh授权密钥中添加ssh密钥

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

这篇关于连接失败:本地主机(Errno :: ECONNREFUSED:连接被拒绝-connect(2))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆