Bugs item #28924, was opened at 2011-02-11 18:46
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28924&group_id=126

Category: RubyGems installer (setup.rb)
Group: v1.5.x
Status: Open
Resolution: None
Priority: 3
Submitted By: William Mason (william)
Assigned to: Nobody (None)
Summary: gem update_rubygems Fails on JRuby 1.5

Initial Comment:
Hi there,

I get a 'NoMethodError' when I try to execute update_rubygems from the command 
line after loading rubygems-update-1.5.2.gem (downloaded from RubyForge).

Incidentally the rubygems-update-1.5.2.gem that is on GemCutter (rubygem.org) 
is corrupt.  It won't even open as a valid zip archive.  The zip file was OK.

I successfully ran the complete rubygems-update process with ruby 1.8.7 
including the: update_rubygems, script.  Worked fine.

Using jRuby 1.5, the:

   gem install rubygems-update-1.5.2.gem

Worked great (apparently).  However the 

    update_rubygems

Script falls over with a: 'NoMethodError' for: 'load_plugins' (see below).

Normally gems work find with jruby.  I tried this process with jRuby v1.3 and 
received a similar fail.  I'm wondering if there's not a supporting gem missing 
on the Java side?  If so it is definitely worth noting in the read-me.

Please advise of how to get the gems working with jRuby.  Also, what was the 
last version of rubygems known to be ok on jRuby (on window).

Many thanks

  Will

--------------------
W:...> ruby c:\bin\ruby\j1.5\bin\update_rubygems
C:/bin/ruby/j1.5/lib/ruby/gems/1.8/gems/rubygems-update-1.5.2/lib/rubygems/gem_runner.rb:84:
 undefined method `load_plugins' for Gem:Module (NoMethodError)
        from 
C:/bin/ruby/j1.5/lib/ruby/gems/1.8/gems/rubygems-update-1.5.2/lib/rubygems/gem_runner.rb:31:in
 `require'
        from 
c:/bin/ruby/j1.5/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
`require'
        from setup.rb:25


----------------------------------------------------------------------

Comment By: Charles Nutter (headius)
Date: 2011-02-16 15:01

Message:
I think I've found the problem.

JRuby usually tries to launch subprocess execution like "exec" or "system" in 
the same JVM, if they start with "ruby" or "jruby". In order to have the 
in-process child get an accurate environment, we pass along the modified env 
hash to it. Unfortunately, RUBYOPT logic is looking at the real process system 
env all the time, if the provided env does not have RUBYOPT set.

As a result, RUBYOPT=rubygems is *still* processed when setup.rb execs itself 
again, but *appears* to have been cleared since we inherit the correct ENV. 
That results in parts of the old rubygems being loaded first and then new 
rubygems pieces load and fail.

I will track this in a JRuby bug.

There are two workarounds:

For users: unset RUBYOPT before updating.

In RubyGems 1.5.x: There are ways to force the command to run in an external 
process always. The easiest is probably to insert "sh -c" or "cmd -c" at the 
beginning. Whether you (RubyGems folks) want to patch around this JRuby issue 
is up to you, but I don't see us putting out a 1.5.7 with just this simple fix 
since 1.6 is almost finished.

To reproduce:

* Download JRuby 1.5.6
* Install rubygems-update gem
* Set RUBYOPT=rubygems
* Attempt to run bin/update_rubygems

----------------------------------------------------------------------

Comment By: Charles Nutter (headius)
Date: 2011-02-16 14:30

Message:
Ok, reproduced by setting RUBYOPT=rubygems.

----------------------------------------------------------------------

Comment By: Charles Nutter (headius)
Date: 2011-02-16 14:26

Message:
Hmm, I was also able to update a 1.5.6 install.

----------------------------------------------------------------------

Comment By: Charles Nutter (headius)
Date: 2011-02-16 14:24

Message:
I was able to do update_rubygems with JRuby 1.6 master today without any 
problems. Of course that's just RG 1.5.0 to RG 1.5.2. Updating from an earlier 
version seems to be where the problems come up...

----------------------------------------------------------------------

Comment By: Charles Nutter (headius)
Date: 2011-02-16 13:36

Message:
Others have been able to get around this by clearing RUBYOPT, which most people 
had set to -rubygems or similar. There appears to be a problem with the order 
in which things get activated under JRuby that we have not sorted out.

I believe this is probably a JRuby issue, perhaps caused by having our openssl 
support in a gem.

----------------------------------------------------------------------

Comment By: William Mason (william)
Date: 2011-02-15 18:43

Message:
Hi,

Addition - This bug has turned out to be quite serious
because any gem operation can now can my windows command
shell. And the JVM /jruby process can't be killed, can't
logout, and can't restart.  That means the only way out is
to power-down.

As I see it I can only clobber jruby and reinstall it with
the installation gem version. That will get attended to
eventually I'm thinking.

I think the hang is probably a JRuby issue.  But it is
instigated by the rubygem incompatibility.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28924&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to