安装ruby1.8.6后,gem错误的解决

在一台干净环境中安装了ruby1.8.6之后,直接输入gem sources -l等操作,都提示:

*** CURRENT SOURCES ***

ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302


解决的方法:
1.下载 rubygems-update-1.3.7.gem:
http://rubyforge.org/frs/download.php/70695/rubygems-update-1.3.7.gem

2.CMD运行: gem install --local rubygems-update-1.3.7.gem
C:share>gem install rubygems-update-1.3.7.gem
Successfully installed rubygems-update, version 1.3.7
Installing ri documentation for rubygems-update-1.3.7...
Installing RDoc documentation for rubygems-update-1.3.7...

3.CMD运行: gem install rubygems-update
C:share>gem install rubygems-update
Successfully installed rubygems-update, version 1.3.7
Installing ri documentation for rubygems-update-1.3.7...
Installing RDoc documentation for rubygems-update-1.3.7...

4.CMD运行: update_rubygems
C:share>update_rubygems
RubyGems 1.3.7 installed

通过以上步骤,升级本地的gem程序,之后就可以进行常见操作了。当然了,gem source服务器推荐用淘宝的。

$ gem sources --remove http://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***

http://ruby.taobao.org

| 0个评论