[Rubygems-developers] Unable to install any gems including system update due to absolute path errors on Windows

Wes Gamble weyus at att.net
Sun Jul 22 14:06:06 EDT 2007


All,

My environment:

Windows XP

C:\eclipse\workspace>ruby -v
ruby 1.8.4 (2005-12-24) [i386-mswin32]

C:\eclipse\workspace>gem environment
RubyGems Environment:
  - VERSION: 0.9.4 (0.9.4)
  - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
  - GEM PATH:
     - c:/ruby/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

If I attempt to install any Rubygem, including the system update, I get 
an error informing me that a clearly absolute path is not absolute.  
Here's an example:

C:\eclipse\workspace>gem update capistrano
Updating installed gems...
Attempting remote update of capistrano
Install required dependency highline? [Yn]  Y
ERROR:  While executing gem ... (ArgumentError)
    install directory 
#<Pathname:c:/ruby/lib/ruby/gems/1.8/gems/highline-1.2.9>
not absolute

This appears to be due to the following code in installer.rb:

private
    def expand_and_validate(directory)
      directory = Pathname.new(directory).expand_path
      unless directory.absolute?     
        raise ArgumentError, "install directory %p not absolute" % directory
      end
      directory.to_str
 end

which depends on the Pathname library, which in turn assumes that any 
directory that doesn't start with "/" is relative.  See below:

C:\eclipse\workspace>irb
irb(main):001:0> require 'pathname'
=> true
irb(main):002:0> 
Pathname.new("C:/ruby/lib/ruby/gems/1.8/gems/highline-1.2.9").absolute?
=> false

How do I fix my installation so that I can continue to use gems?

Thanks,
Wes


More information about the Rubygems-developers mailing list