无法解决rubygems.org(重定向过多)

时间:2014-04-23 02:48:45

标签: ruby linux rubygems vagrant

由于某种原因,我的流浪汉无法解决rubygems.org。它昨天工作正常,今天我没有做任何改变,现在它已经不再适用了:

Fresh Ubuntu install

vagrant -v # 1.5.3
vagrant init hashicorp/precise64 # ubuntu
vagrant up
vagrant ssh

安装ruby gems(失败)

sudo apt-get update
sudo apt-get install rubygems -y

# here comes the failure...
sudo gem install librarian-puppet

"ERROR:  Could not find a valid gem 'librarian-puppet' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
too many redirects (http://www1.dlinksearch.com/?..."

无法解析rubygems.org

wget rubygems.org 

"Resolving rubygems.org (rubygems.org)... ::ffff:67.215.65.145, 54.245.255.174
Connecting to rubygems.org (rubygems.org)|::ffff:67.215.65.145|:80... connected.
HTTP request sent, awaiting response... 303 See Other
Location: http://www1.dlinksearch.com/?url=rubygems%2Eorg [following]
--2014-04-23 02:28:15--  http://www1.dlinksearch.com/?url=rubygems%2Eorg
Resolving www1.dlinksearch.com (www1.dlinksearch.com)... ::ffff:67.215.65.145, 
20 redirections exceeded."

其他网站似乎很好

wget google.com
Resolving google.com (google.com)... 173.194.126.8, 173.194.126.14, 173.194.126.2, ...
HTTP request sent, awaiting response... 200 OK
2014-04-23 02:36:57 (651 KB/s) - `index.html.2' saved [13872]

我可以通过IP地址解析

wget 54.245.255.174 
--2014-04-23 02:44:59--  http://rubygems.org/
Resolving rubygems.org (rubygems.org)... ::ffff:67.215.65.145, 54.245.255.174
HTTP request sent, awaiting response... 200 OK

更多信息

gem env 
  - RUBYGEMS VERSION: 1.8.15
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
  ...
  - REMOTE SOURCES:
    - http://rubygems.org/

它正在运作

  • 昨天晚上工作正常!
  • VM / etc / hosts看起来很好
  • 我可以从桌面浏览器访问rubygems.org而不会出现任何问题
  • 已经尝试过销毁并创建新的虚拟链接
  • 尝试重新启动计算机

1 个答案:

答案 0 :(得分:1)

所以从评论来看,显然存在DNS缓存问题,其中" :: ffff:67.215.65.145"回来作为rubygems的有效地址。 " 54.245.255.174"是一个有效的地址,dig @8.8.8.8 ANY rubygems.org会显示。