History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-136
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Ugo Cei
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

Can't install camping as a gem

Created: 11/Sep/06 10:29 AM   Updated: 08/Dec/06 12:27 PM
Component/s: None
Affects Version/s: JRuby 0.9.1
Fix Version/s: JRuby 0.9.1

Time Tracking:
Not Specified

File Attachments: 1. File JRUBY-136.diff (2 kb)



 Description  « Hide
I've tried to install camping following Ola Bini's tutorial, but when executing:

$ jruby $JRUBY_HOME/bin/gem install camping --no-ri --no-rdoc --include-dependencies

I get:

Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (NoMethodError)
undefined method `rubygems_version' for 0.9.7:Gem::Version

This is using SVN revision 2232. Using 0.9.0 I get a slightly different error message but still no installation:

ERROR: While executing gem ... (NoMethodError)
undefined method `version_requirements' for #<Gem::Specification name=rdf-redland version=0.5>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tim Azzopardi - 11/Sep/06 05:20 PM
 
C:\dev\jruby\antbuilder>gem list --remote AntBuilder

*** REMOTE GEMS ***
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (NoMethodError)
    undefined method `name' for 4.4.1:Gem::Version

C:\dev\jruby\antbuilder>gem list --remote AntBuilder

*** REMOTE GEMS ***
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (NoMethodError)
    undefined method `version_requirements' for #<Gem::Specification name=syndication version=0.4.0>

C:\dev\jruby\antbuilder>gem list --remote AntBuilder 

Tim Azzopardi - 11/Sep/06 05:21 PM
Basically if you keep trying the problem goes away, usually the second time, but in this case, the third time.

Tim Azzopardi - 11/Sep/06 05:26 PM
Charles said on mailing list: "Ola and I were talking and thought it would be worth hooking this
particular error and running an install/uninstall cycle until it
happens again, so we can get a decent trace. My theory is that it's
something in RubyGems or in a core library that makes assumptions
about how the interpreter works. Since it's intermittent, signs point
toward threading, where we're quite a bit different from Ruby because
of our unpredictable scheduler (whatever the OS provides). Ruby would
see issues infrequently because their scheduler is more
predictable...but not 100% predictable. "

Tim Azzopardi - 11/Sep/06 05:33 PM

This could well be a general ruby/gem bug: google for

"ERROR: While executing gem ... (NoMethodError)

and you get 850 results

Typical example is :

http://www.vmunix.com/mark/blog/archives/2006/04/08/ruby-gems-still-doesnt-work-on-104/

which shows the same symptoms.


Michael Studman - 17/Oct/06 06:59 PM
Attaching patch that replicates rubygems fix for this problem.

I've had to extend the rubygems solution a small amount because otherwise we get some further errors (100% of the time) due to some flakey gemspecs out in the wild interracting with our divergent marshalling behaviour and the hash / equals methods of certain gem objects.

Specifics of the problem (from email to mailing list):
1) The rubygems fix (by Jim and co.) stops the old problem of random TypeErrors by introducing more rigorous hash and equals methods.
2) JRuby marshall code causes various rubygems objects to have their hash and equals methods called quite a bit more often than MRI does (hash in particular). Typical hash bucket stuff, I expect.
3) Because hash and equals are implemented more rigorously it's turning up some problems in one or two gems out in the wild that have flakey gem specs (null values or values with the wrong type etc).
4) JRuby chokes on these gems in a gem bulk update every time because of #2.


Charles Oliver Nutter - 17/Oct/06 08:20 PM
So this is an odd situation: we're committing a change based on what will be in the next RubyGems release, but we don't have that release to include with 0.9.1. However since it technically is fixed with this patch in our dist, we'll mark it as fixed now. It's a standing item to keep up-to-date with RubyGems, so we'll just cover that as its own task.

Charles Oliver Nutter - 08/Dec/06 12:27 PM
Closing 0.9.1 resolved issues.