这是什么情况,怎么哪个也不行了,网上搜只是说 rubygems.org 可能被什么,怎么 taobao.org 也不行啊
hao@linux-qtew:~> gem sources -a https://ruby.taobao.org
Error fetching https://ruby.taobao.org:
Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.site" port 443 (https://your-dns-needs-immediate-attention.site/specs.4.8.gz)
hao@linux-qtew:~> gem sources -a http://ruby.taobao.org
Error fetching http://ruby.taobao.org:
Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.site" port 80 (http://your-dns-needs-immediate-attention.site/specs.4.8.gz)
hao@linux-qtew:~> gem sources -a https://rubygems.org/
Error fetching https://rubygems.org/:
Errno::ETIMEDOUT: Connection timed out - connect(2) for "s3.amazonaws.com" port 443 (https://api.rubygems.org/specs.4.8.gz)
下面是 debug 信息,大神帮忙看看是什么情况
hao@linux-qtew:~> gem sources -a https://ruby.taobao.org --debug -V
NOTE: Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /home/hao/.rvm/rubies/ruby-2.2.1/lib64/ruby/2.2.0/resolv.rb:168 - LoadError
Exception `Resolv::DNS::Config::NXDomain' at /home/hao/.rvm/rubies/ruby-2.2.1/lib64/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org
Exception `Errno::EEXIST' at /home/hao/.rvm/rubies/ruby-2.2.1/lib64/ruby/2.2.0/fileutils.rb:252 - File exists @ dir_s_mkdir - /home/hao/.gem/specs/your-dns-needs-immediate-attention.site%443
Exception `Errno::ENOENT' at /home/hao/.rvm/rubies/ruby-2.2.1/lib64/ruby/site_ruby/2.2.0/rubygems/remote_fetcher.rb:300 - No such file or directory @ rb_file_s_stat - /home/hao/.gem/specs/your-dns-needs-immediate-attention.site%443/specs.4.8
Exception `Errno::ECONNREFUSED' at /home/hao/.rvm/rubies/ruby-2.2.1/lib64/ruby/2.2.0/net/http.rb:879 - Connection refused - connect(2) for "your-dns-needs-immediate-attention.site" port 443
Exception `Gem::RemoteFetcher::FetchError' at /home/hao/.rvm/rubies/ruby-2.2.1/lib64/ruby/site_ruby/2.2.0/rubygems/remote_fetcher.rb:286 - Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.site" port 443 (https://your-dns-needs-immediate-attention.site/specs.4.8.gz)
Error fetching https://ruby.taobao.org:
Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.site" port 443 (https://your-dns-needs-immediate-attention.site/specs.4.8.gz)
已解决,我用的系统是 opensuse13.2 的,它自动成的主机名是带 site 域名的
hao@linux-qtew:~> hostname
linux-qtew.site
Background: the tld ".site" is offically registered and thus no longer available for private use.
ToDo: Change your private tld, to something NOT registered.
Gotchas: ".local" is reserved for mDNS / ZeroConf / Bonjour / Rendezvous. Do NOT use it for DNS / DHCP !
Examples: ".box", ".lan" : both are suggested by some Internet-Connect-Routers (DSL/Cable/Fibre) ".lnet", ".your-name-here" (.ArupRakshit for you) : possible, worth to try. 修改:goto YAST -> Netwrok devices -> Network Settings -> Hostname/DNS -> Domain Name (and here put your name).
还要修改:/etc/resolve.conf,注掉 search site
hao@linux-qtew:~> cat /etc/resolv.conf
### Please remove (at least) this line when you modify the file!
#search site
nameserver 223.5.5.5
nameserver 223.6.6.6