Gem gem 添加源的时候报错,SocketError: getaddrinfo: Name or service not known

bill_yang1016 · May 29, 2015 · Last by bill_yang1016 replied at May 29, 2015 · 3752 hits

gem sources -a http://ruby.taobao.org/
Error fetching http://ruby.taobao.org/: SocketError: getaddrinfo: Name or service not known (http://ruby.taobao.org/specs.4.8.gz) 怀疑是解析不了域名,然后再 hosts 中添加了 ruby 镜像的 ip 地址,发现还是连不上;

gem sources -a http://ruby.taobao.org/ Error fetching http://ruby.taobao.org/: Errno::ETIMEDOUT: Connection timed out - connect(2) (http://ruby.taobao.org/specs.4.8.gz)

用公司内部的源也是报同样的错误: SocketError: getaddrinfo: Name or service not known

有人知道是什么原因吗?

请执行

curl -V http://ruby.taobao.org/specs.4.8.gz

问题解决 是 DNS 服务器有问题,导致解析不了域名了; 把 resolv.conf 里的服务器改为可用的 DNS 服务器就 OK 了。

You need to Sign in before reply, if you don't have an account, please Sign up first.