开发者

Ruby gem - A GEM error shown during run the commend: gem update --system

I’m a freshman on Ruby and now trying to install ruby on my machine according to the Tutorial on http://wiki.openqa.org/display/WTR/Tutorial

However, after I installed the ruby186-26, and run the command “gem update --system”, the following error occurred:

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:/rub开发者_开发技巧y/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run' 
from c:/ruby/bin/gem:23

Meanwhile, we have tried this on other machines and the result turned out ok.

Thus, my question is why the error happened on my pc? Have you met this kind of error before?


this is caused by the version of ruby you are trying to install, which included an outdated version of rubygems that cannot auto-update itself.

since you are trying to install ruby on a windows machine, you need to get the installer from

http://rubyinstaller.org

get the latest patch release of whatever version you need - there is a 1.8.6, 1.8.7, and 1.9.1 installer available.

once you have installed the right version from this site, you will be able to run gem update --system without any issues.


Execute Below command and its works

gem install hpricot --platform=mswin32

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜