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

Key: JRUBY-1771
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Thomas E Enebo
Reporter: Stephen Bannasch
Votes: 1
Watchers: 1
Operations

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

gem install mongrel broken

Created: 22/Dec/07 11:07 PM   Updated: 23/Apr/08 10:03 AM
Component/s: None
Affects Version/s: None
Fix Version/s: JRuby 1.1RC1

Time Tracking:
Not Specified

Environment: MacOS X 10.4.11, Jruby trunk r5341


 Description  « Hide
This may or may not be an issue with JRuby – or perhaps with the patched version of rubgems 1.0.0 in JRuby.

Just installing mongrel causes an error when it tries to build fastthread:

$ gem install mongrel -V
Installing gem fastthread-1.0.1
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/test/test_queue.rb
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/test/test_mutex.rb
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/test/test_condvar.rb
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/test/test_all.rb
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/setup.rb
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/Manifest
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext/fastthread/fastthread.c
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext/fastthread/extconf.rb
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/CHANGELOG
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/fastthread-1.0.1/fastthread.gemspec
Building native extensions.  This could take a while...
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
ERROR:  Error installing mongrel:
        ERROR: Failed to build gem native extension.

See RubyForge Mongrel tracker here for more info:

16517 error when installing on jruby (fastthread dependency)
http://rubyforge.org/tracker/index.php?func=detail&aid=16517&group_id=1306&atid=5145

Checking out trunk mongrel from svn and building it in JRuby also doesn't work but I'll describe that in a different bug report.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Stephen Bannasch - 23/Dec/07 02:31 PM
Specifying the platform as 'jruby' does work (jruby r5344):
$ gem install mongrel --platform jruby
Updating metadata for 13 gems from http://gems.rubyforge.org
.............
complete
Successfully installed mongrel-1.1.2
1 gem installed
Installing ri documentation for mongrel-1.1.2...
Installing RDoc documentation for mongrel-1.1.2...

Ola Bini - 23/Dec/07 02:40 PM
Well, traditionally if you installed remotely, you'd get the choice of which mongrel version to install, then you'd have to choose jruby. Of course, fastthread is a C library and as such cannot be used from JRuby.

If something has changed and the default behavior is to try to install fastthread, that's not good, of course. Is this something the new RubyGems version has caused?


Stephen Bannasch - 23/Dec/07 04:11 PM
Yes, I think this is related to the new rubygems.

I'm not clear yet on the details on how gem running locally in jruby communicates with the gem repository and the specs for the gem being installed to indicate what platform is running locally and how that affects what is downloaded and run to install the gem.

But it seems clear that the general issue is not with fastthread but that 'gem install mongrel' running in jruby trunk (with our slightly patched version of rubygems) is following the process for installing the MRI version of mongrel. Fasthread is just where the process first breaks.

Of course there were some other MRI mongrel gems installed as dependencies that while they installed successfully are not needed on jruby:

  • cgi_multipart_eof_fix
  • daemons

Stephen Bannasch - 23/Dec/07 06:57 PM
I also can't install hpricot for what looks like the same reason – though setting platform to either 'jruby' or 'java' doesn't fix the problem.

]$ gem install hpricot
Building native extensions. This could take a while...
extconf.rb:1:in `require': no such file to load – mkmf (LoadError)
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.

/Users/stephen/dev/java/src/moz/jrubytrunk/bin/jruby extconf.rb install hpricot

Gem files will remain installed in /Users/stephen/dev/java/src/moz/jrubytrunk/lib/ruby/gems/1.8/gems/hpricot-0.6 for inspection.
Results logged to /Users/stephen/dev/java/src/moz/jrubytrunk/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/gem_make.out
[~/dev/java/src/moz/jrubytrunk]$ gem install hpricot --platform jruby
Building native extensions. This could take a while...
extconf.rb:1:in `require': no such file to load – mkmf (LoadError)
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.

/Users/stephen/dev/java/src/moz/jrubytrunk/bin/jruby extconf.rb install hpricot --platform jruby

Gem files will remain installed in /Users/stephen/dev/java/src/moz/jrubytrunk/lib/ruby/gems/1.8/gems/hpricot-0.6 for inspection.
Results logged to /Users/stephen/dev/java/src/moz/jrubytrunk/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/gem_make.out
[~/dev/java/src/moz/jrubytrunk]$ gem install hpricot --platform java
Building native extensions. This could take a while...
extconf.rb:1:in `require': no such file to load – mkmf (LoadError)
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.

/Users/stephen/dev/java/src/moz/jrubytrunk/bin/jruby extconf.rb install hpricot --platform java

Gem files will remain installed in /Users/stephen/dev/java/src/moz/jrubytrunk/lib/ruby/gems/1.8/gems/hpricot-0.6 for inspection.
Results logged to /Users/stephen/dev/java/src/moz/jrubytrunk/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/gem_make.out
{code


Evan Weaver - 03/Jan/08 11:35 AM
In gems 1.0 the JRuby platform is now called "java". I don't really understand the reasoning but a similar change was made for the mswin32 platform.

mackenzie:~/p eweaver$ jruby -S gem install mongrel --platform java
Successfully installed mongrel-1.1.3

But JRuby is not requesting either the java platform or the jruby platform (still wrong, but would snag version 1.1.2 or lower) by default.


Evan Weaver - 03/Jan/08 11:37 AM
Note that gems no longer lists every platform by default as Ola says; it tries to install the correct one automatically. This is new behavior in gems 1.0. So perhaps it never identified the platform correctly before, but people would manually always choose 'jruby' so it never mattered until now.

This probably needs a priority bump because it makes it impossible to ship gems with extensions.


Thomas E Enebo - 03/Jan/08 04:35 PM
Fixed in commit 5481 on trunk

Stephen Bannasch - 03/Jan/08 04:50 PM
hmmm ... just updated to 5481 and it's still not working for me:
$ gem uninstall mongrel
Successfully uninstalled mongrel-1.1.3-java
Remove executables and scripts for
'mongrel_rails' in addition to the gem? [Yn]  Y
Removing mongrel_rails

$ gem install mongrel
Updating metadata for 33 gems from http://gems.rubyforge.org
.................................
complete
ERROR:  Error installing mongrel:
        mongrel requires fastthread (>= 1.0.1)

Thomas E Enebo - 03/Jan/08 05:06 PM
5481 was wrong. 5482 is a good fix