JRuby

Error installing gem: install directory not absolute (Mac OS X 10.4.9)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: JRuby 1.0.0RC1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Mac OS X 10.4.9
  • Number of attachments :
    0

Description

Received the following error when installing rake to a JRuby-unique GEM_HOME (no gems previously installed):

install directory "/usr/local/jruby/lib/ruby/gems/1.8/gems/rake-0.7.3" not absolute

Issue Links

Activity

Hide
Albert Strasheim added a comment -

I am running into this same issue with the latest trunk build on Windows. I was previously able to install the Rails gems, so I'm not sure what's wrong now. I have GEM_HOME set correctly as far as I can tell.

Show
Albert Strasheim added a comment - I am running into this same issue with the latest trunk build on Windows. I was previously able to install the Rails gems, so I'm not sure what's wrong now. I have GEM_HOME set correctly as far as I can tell.
Hide
Albert Strasheim added a comment -

I have reduced the problem to the following simple from what happens in rubygems/installer.rb around line 351:

directory = 'C:\jruby\jruby-1.0.0RC2\lib\ruby\gems/1.8/gems/cmdparse-2.0.2'
puts directory
puts File.expand_path(directory)
unless File.expand_path(directory) == directory then
raise ArgumentError, "install directory %p not absolute" % directory
end

On my system this prints:

C:\jruby>jruby abspath.rb
C:\jruby\jruby-1.0.0RC2\lib\ruby\gems/1.8/gems/cmdparse-2.0.2
C:/jruby/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/cmdparse-2.0.2
:-1: install directory "C:\\jruby\\jruby-1.0.0RC2\\lib\\ruby
gems/1.8/gems/cmdparse-2.0.2" not absolute (ArgumentError)

So what seems to be going wrong (at least on Windows) is that GEM_PATH should only use /, not \.

Show
Albert Strasheim added a comment - I have reduced the problem to the following simple from what happens in rubygems/installer.rb around line 351: directory = 'C:\jruby\jruby-1.0.0RC2\lib\ruby\gems/1.8/gems/cmdparse-2.0.2' puts directory puts File.expand_path(directory) unless File.expand_path(directory) == directory then raise ArgumentError, "install directory %p not absolute" % directory end On my system this prints: C:\jruby>jruby abspath.rb C:\jruby\jruby-1.0.0RC2\lib\ruby\gems/1.8/gems/cmdparse-2.0.2 C:/jruby/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/cmdparse-2.0.2 :-1: install directory "C:\\jruby\\jruby-1.0.0RC2\\lib\\ruby
gems/1.8/gems/cmdparse-2.0.2" not absolute (ArgumentError) So what seems to be going wrong (at least on Windows) is that GEM_PATH should only use /, not \.
Hide
Charles Oliver Nutter added a comment -

Ugh...I don't know if there's even a way to fix this in JRuby. When we expand_path, we turn everything into / so this will never match. I'd say the only way this could ever work is if they do a better test in RubyGems. It's going to be near impossible for us to preserve the original / versus \ in the filename.

Show
Charles Oliver Nutter added a comment - Ugh...I don't know if there's even a way to fix this in JRuby. When we expand_path, we turn everything into / so this will never match. I'd say the only way this could ever work is if they do a better test in RubyGems. It's going to be near impossible for us to preserve the original / versus \ in the filename.
Hide
Evan Light added a comment -

Sorry. This isn't a JRuby issue. Rubygems, in installer.rb, checks to see if File.expand_path(<GEM_HOME_PATH>) == <GEM_HOME_PATH>. The problem, in my case, is that I have my GEM_HOME keyed to my JRuby install through a soft link. This was foolish of me actually – but possibly reasonable for testing gems against particular Ruby interpreter versions.

In any event, File.expand_path resolves the soft link to it's real path which causes the equality check to fail and hence my error.

For me, this means that I'll be migrating my JRuby GEM_HOME external to my JRuby installations. However, this may be something worth taking up with the Rubygems fellas.

Show
Evan Light added a comment - Sorry. This isn't a JRuby issue. Rubygems, in installer.rb, checks to see if File.expand_path(<GEM_HOME_PATH>) == <GEM_HOME_PATH>. The problem, in my case, is that I have my GEM_HOME keyed to my JRuby install through a soft link. This was foolish of me actually – but possibly reasonable for testing gems against particular Ruby interpreter versions. In any event, File.expand_path resolves the soft link to it's real path which causes the equality check to fail and hence my error. For me, this means that I'll be migrating my JRuby GEM_HOME external to my JRuby installations. However, this may be something worth taking up with the Rubygems fellas.
Hide
Evan Light added a comment -

Woops. Should've read your comment better before posting mine.

Still, I agree that this problem should possibly be resolved through Rubygems.

Show
Evan Light added a comment - Woops. Should've read your comment better before posting mine. Still, I agree that this problem should possibly be resolved through Rubygems.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: