RubyGem-在运行command:gem update--system时显示的一个gem错误

RubyGem-在运行command:gem update--system时显示的一个gem错误,ruby,gem,Ruby,Gem,我是Ruby的一年级新生,现在正试图根据上的教程在我的机器上安装Ruby 但是,在我安装ruby186-26并运行命令“gem update--system”后,发生了以下错误: C:\Documents and Settings\e482090\Desktop>gem update --system c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initialize': Inval id argument -

我是Ruby的一年级新生,现在正试图根据上的教程在我的机器上安装Ruby

但是,在我安装ruby186-26并运行命令“gem update--system”后,发生了以下错误:

C:\Documents and Settings\e482090\Desktop>gem update --system
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initialize': Inval
id argument - <Not Set>/.gemrc (Errno::EINVAL) 
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `open' 
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initi
alize' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `new' 
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `do_con
figuration' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run' 
from c:/ruby/bin/gem:23

C:\Documents and Settings\e482090\Desktop>gem install watir
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initialize': Inval
id argument - <Not Set>/.gemrc (Errno::EINVAL) 
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `open' 
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initi
alize' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `new' 
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `do_con
figuration' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run' 
from c:/ruby/bin/gem:23
C:\Documents and Settings\e482090\Desktop>gem update--system
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in'initialize':无效
id参数-/.gemrc(错误号::EINVAL)
来自c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in'open'
来自c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in`initi
alize'from c:/ruby/lib/ruby/site\u ruby/1.8/rubygems/gem\u runner.rb:36:in'new'
来自c:/ruby/lib/ruby/site\u ruby/1.8/rubygems/gem\u runner.rb:36:in'do\u con
c:/ruby/lib/ruby/site\u ruby/1.8/rubygems/gem\u runner.rb:25:in'run'
来自c:/ruby/bin/gem:23
C:\Documents and Settings\e482090\Desktop>gem install watir
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in'initialize':无效
id参数-/.gemrc(错误号::EINVAL)
来自c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in'open'
来自c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in`initi
alize'from c:/ruby/lib/ruby/site\u ruby/1.8/rubygems/gem\u runner.rb:36:in'new'
来自c:/ruby/lib/ruby/site\u ruby/1.8/rubygems/gem\u runner.rb:36:in'do\u con
c:/ruby/lib/ruby/site\u ruby/1.8/rubygems/gem\u runner.rb:25:in'run'
来自c:/ruby/bin/gem:23
同时,我们已经在其他机器上进行了试验,结果证明是正确的


因此,我的问题是,为什么错误发生在我的电脑上?你以前遇到过这种错误吗

这是由于您尝试安装的ruby版本导致的,其中包括一个无法自动更新自身的过时rubygems版本

由于您试图在windows计算机上安装ruby,因此需要从

获取您需要的任何版本的最新修补程序版本-有1.8.6、1.8.7和1.9.1安装程序可用


从该站点安装正确的版本后,您将能够运行
gem update--system
,而不会出现任何问题。

执行下面的命令及其工作原理


gem安装hpricot--platform=mswin32

Thx Bailey以获取您的回复。但是,在删除旧版本的Ruby并安装新版本(版本1.9.1-p378)之后,我们在推荐控制台中输入了以下推荐,结果是:------------C:\Documents and Settings\e482090\Desktop>gem-v 1.3.7 C:\Documents and Settings\e482090\Desktop>gem update——系统更新RubyGems错误:执行gem时。。。(错误号::EINVAL)参数无效------------------------------------------我的环境是Windows XP Professional SP2,我的帐户属于管理员组。