[Ruby新手教学] 要有中国特色
今天部署一个系统,发现不能获取gem包,于是看看怎么回事
$ gem -v 1.3.6 $ gem update --system JRuby limited openssl loaded. http://jruby.org/openssl gem install jruby-openssl for full support. Updating RubyGems Updating rubygems-update ERROR: While executing gem ... (Gem::GemNotFoundException) could not find gem rubygems-update locally or in a repository $ gem install rubygems-update JRuby limited openssl loaded. http://jruby.org/openssl gem install jruby-openssl for full support. ERROR: could not find gem rubygems-update locally or in a repository
不知道为什么连不上,试试看,好像可以ping通
$ gem source *** CURRENT SOURCES *** http://rubygems.org/ $ ping rubygems.org PING rubygems.org (72.4.120.124) 56(84) bytes of data. 64 bytes from rubygems.org (72.4.120.124): icmp_seq=2 ttl=49 time=368 ms
于是决定下载,这时发现了问题
$ wget http://rubygems.org/downloads/rubygems-update-1.8.5.gem --2011-07-13 15:43:40-- http://rubygems.org/downloads/rubygems-update-1.8.5.gem 正在解析主机 rubygems.org... 72.4.120.124 Connecting to rubygems.org|72.4.120.124|:80... 已连接。 已发出 HTTP 请求,正在等待回应... 302 Found 位置:http://rubygems.org/gems/rubygems-update-1.8.5.gem [跟随至新的 URL] --2011-07-13 15:43:42-- http://rubygems.org/gems/rubygems-update-1.8.5.gem Reusing existing connection to rubygems.org:80. 已发出 HTTP 请求,正在等待回应... 302 Found 位置:http://production.cf.rubygems.org/gems/rubygems-update-1.8.5.gem [跟随至新的 URL] --2011-07-13 15:43:42-- http://production.cf.rubygems.org/gems/rubygems-update-1.8.5.gem 正在解析主机 production.cf.rubygems.org... 失败:域名解析暂时失败。 wget: unable to resolve host address `production.cf.rubygems.org'
进一步了解,发现是DNS污染,现在问题就简单了,查到对应的ip,然后修改
sudo vi /etc/hosts 216.137.53.162 production.cf.rubygems.org
下面就好办了
总结,在贵国,要考虑的问题有很多
相关推荐
AndesStay 2020-06-12
zamesking 2020-06-09
LUCIEN0 2019-11-04
HJWZYY 2020-04-24
sunzxh 2020-03-06
Ben的程序员生涯 2013-06-01
starX 2019-12-15
江城守望者 2007-05-28
shumark 2014-07-07
huangcancan 2014-10-20
赫赫小虾 2012-12-24
liyongkuan 2012-03-25
gedoua 2014-03-18
selaginella 2011-09-17
huhuhuemail 2012-01-18
DevilGoddy 2019-06-30