由于某些原因,我的迷途虚拟机无法解析rubygems.org。昨天天气很好,今天我没有做任何改变,现在它不再起作用了:
新Ubuntu安装
vagrant -v # 1.5.3
vagrant init hashicorp/precise64 # ubuntu
vagrant up
vagrant ssh安装红宝石(失败)
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/它起作用了
发布于 2014-04-24 04:32:55
因此,从注释中可以看出,很明显存在一个DNS缓存问题,其中"::ffff:67.215.65.145“作为rubygems的有效地址返回。如dig @8.8.8.8 ANY rubygems.org所示,"54.245.255.174“是一个有效地址。
https://stackoverflow.com/questions/23233910
复制相似问题