tags:

views:

79

answers:

2

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:inopen' 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:innew' 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:inrun' 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:inopen' 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:innew' 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:inrun' 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?

A: 

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.

Derick Bailey
Thx Bailey for your reply. However, after removing the old version of the Ruby and installing the new one (version 1.9.1-p378), we entered the following commend in the commend console and the result turned out that: --------------------------- C:\Documents and Settings\e482090\Desktop>gem -v 1.3.7 C:\Documents and Settings\e482090\Desktop>gem update --system Updating RubyGems ERROR: While executing gem ... (Errno::EINVAL) Invalid argument - <Not Set> -------------------------------------- My environment is Windows XP Professional SP2 and my account belongs to the Admin Group.
Alex
A: 

Execute Below command and its works

gem install hpricot --platform=mswin32

Amit