Error when installing on jruby (fastthread dependency)

I’m running jruby trunk which has integrated rubygems 1.0.0 and when
I try and install mongrel with gem it blows up when the fastthread
dependency tries to do a native compilation.

I couldn’t find a copy of the gemspec in the svn checkout but looking
at the one installed when gem installing mongrel didn’t show any
platform differentiation. There is platform differentiation in the
rake file.

It looks like the gemspec is derived somehow from the rake task (the
rake file is in the gemspec as comments).

Here’s the error when I try and install mongrel:

$ 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.

bug report filed:
http://rubyforge.org/tracker/index.php?func=detail&aid=16517&group_id=1306&atid=5145

On Dec 22, 2007 10:29 AM, Stephen B.
[email protected]
wrote:

rake file is in the gemspec as comments).
1.0.1/test/test_condvar.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.

Stephen,

Could you please verify that this issue has not been fixed on Mongrel
trunk?

Thank you!

~Wayne

(use rake install to install from trunk)

At 10:55 AM -0500 12/22/07, Wayne E. Seguin wrote:

Stephen,

Could you please verify that this issue has not been fixed on Mongrel trunk?

Thank you!

Hi Wayne,

Testing with JRuby trunk and r922 (trunk) of Mongrel.

After installing the echoe gem rake install compiled the ragel code,
tarred up an archive and died here:

mongrel-1.1.1/test/test_ws.rb
mongrel-1.1.1/test/testhelp.rb
mongrel-1.1.1/TODO
mongrel-1.1.1/tools/
mongrel-1.1.1/tools/trickletest.rb
cd -
WARNING: no email specified
WARNING: no homepage specified
WARNING: bin/mongrel_rails is missing #! line
rake aborted!
can’t convert YAML::JvYAML::Map into String

And indeed

bin/mongrel_rails

Has no #! line. It should have:

#!/usr/bin/env jruby

On Dec 22, 2007 7:48 PM, Stephen B.
[email protected] wrote:

WARNING: bin/mongrel_rails is missing #! line

The she_bang warning is just that, a warning, I have tested the same
here with latest rubygems and even these warnings, the gem get built.

could you try running the gem build based on the generated gemspec file?
(it should be inside pkg/mongrel-1.1.1)

Maybe is failing in the Gem::Specification#to_yaml
(I don’t have jruby to test it).

Regards,


Luis L.
Multimedia systems

A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams

At 9:45 PM -0500 12/22/07, Evan W. wrote:

You have to cross package. Regular JRuby still has problems with
signed gems and other gem-related things.

rake java package

I tried that with the latest svn co from jruby (5341) and mongrel (925)
and still get the error:

can’t convert YAML::JvYAML::Map into String
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/site_ruby/1.8/rubygems/package.rb:738:in
`add_file’

Should I file a new bug report? The original name: “error when
installing on jruby (fastthread dependency)” doesn’t describe the
problem I am reporting now.

Also, please follow the bug here:

http://rubyforge.org/tracker/index.php?func=detail&aid=16517&group_id=1306&atid=5145

See more details in the bug report.

On Dec 22, 2007 5:53 PM, Luis L. [email protected] wrote:

could you try running the gem build based on the generated gemspec file?
(it should be inside pkg/mongrel-1.1.1)

Maybe is failing in the Gem::Specification#to_yaml
(I don’t have jruby to test it).

It’s failing in the gempackage task:

Here’s a truncated copy of the stack trace:

rubygems/package.rb:738:in add_file' rubygems/package.rb:738:in open_from_io’
rubygems/package.rb:738:in open' rubygems/package.rb:790:in open’
rubygems/builder.rb:68:in write_package' rubygems/builder.rb:68:in build’
rake/gempackagetask.rb:86:in define' rake/gempackagetask.rb:85:in when_writing’
rake/gempackagetask.rb:85:in `define’

You have to cross package. Regular JRuby still has problems with
signed gems and other gem-related things.

rake java package

Also, please follow the bug here:

http://rubyforge.org/tracker/index.php?func=detail&aid=16517&group_id=1306&atid=5145

Evan

At 7:53 PM -0300 12/22/07, Luis L. wrote:

could you try running the gem build based on the generated gemspec file?
(it should be inside pkg/mongrel-1.1.1)

I get the same yaml error:

[~/dev/rails/external/mongrel/pkg/mongrel-1.1.2]$ gem build
mongrel.gemspec
WARNING: no email specified
WARNING: no homepage specified
WARNING: bin/mongrel_rails is missing #! line
ERROR: While executing gem … (TypeError)
can’t convert YAML::JvYAML::Map into String

Here’s the gemspec file:

file: pkg/mongrel-1.1.2/mongrel.gemspec

Gem::Specification for Mongrel-1.1.2

Originally generated by Echoe

Gem::Specification.new do |s|
s.name = %q{mongrel}
s.version = “1.1.2”
s.platform = %q{java}

s.specification_version = 2 if s.respond_to? :specification_version=

s.required_rubygems_version = Gem::Requirement.new(">= 0") if
s.respond_to? :required_rubygems_version=
s.authors = [“Zed A. Shaw”]
s.date = %q{2007-12-22}
s.default_executable = %q{mongrel_rails}
s.description = %q{A small fast HTTP library and server that runs
Rails, Camping, Nitro and Iowa apps.}
s.email = %q{}
s.executables = [“mongrel_rails”]
s.has_rdoc = true
s.homepage = %q{}
s.require_paths = [“lib”, “ext”]
s.required_ruby_version = Gem::Requirement.new(">= 1.8.4")
s.rubyforge_project = %q{mongrel}
s.rubygems_version = %q{1.0.0}
s.summary = %q{A small fast HTTP library and server that runs Rails,
Camping, Nitro and Iowa apps.}
s.test_files = [“test/test_cgi_wrapper.rb”, “test/test_command.rb”,
“test/test_conditional.rb”, “test/test_configurator.rb”,
“test/test_debug.rb”, “test/test_handlers.rb”, “test/test_http11.rb”,
“test/test_redirect_handler.rb”, “test/test_request_progress.rb”,
“test/test_response.rb”, “test/test_stats.rb”,
“test/test_uriclassifier.rb”, “test/test_ws.rb”]

s.add_dependency(%q<gem_plugin>, [">= 0.2.3"])
end

Can we move all discussion to the bug report? This is hard to keep track
of.

Thanks

Evan

On Dec 22, 2007 11:01 PM, Stephen B.

The remaining issue is why JRuby didn’t find that build in the gem
index and installed 1.0.2 instead. Seems like a JRuby problem to me?

Evan

On Dec 22, 2007 11:57 PM, Stephen B.

I was able to get the mongrel gem installed in JRuby by first
compiling it with MRI but specifying java:

$ svn co http://mongrel.rubyforge.org/svn/trunk mongrel
$ cd mongrel
$ rake package java

then in JRuby

$ cd mongrel/pkg
$ gem install mongrel-1.1.2-java.gem
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…

At 12:23 AM -0500 12/23/07, Evan W. wrote:

The remaining issue is why JRuby didn’t find that build in the gem
index and installed 1.0.2 instead. Seems like a JRuby problem to me?

Evan

I don’t think it was ever trying to install mongrel 1.0.2.

This comment and more is in the bug tracker.

On second thought, it’s probably a gems/RubyForge problem. JRuby gems
used to be named -jruby.gem so we had continued this naming scheme.
But gems 1.0 changed the way the architecture/platform distinction is
handled, and now builds gems that end in -java.gem. RubyForge probably
updated to the gems 1.0 indexer and stopped indexing -jruby gems.

I dunno whether JRuby can install -jruby, or -java, or both. I
uploaded a gem ending in -java so we will see.

Evan

On Dec 23, 2007 1:01 AM, Stephen B.
[email protected] wrote:

At 7:53 PM -0300 12/22/07, Luis L. wrote:

could you try running the gem build based on the generated gemspec file?
(it should be inside pkg/mongrel-1.1.1)

I get the same yaml error:

Ok, even you got it solved (at this time), will be good if you can
submit this gemspec build issues to RubyGems Tracker, so they can have
something to work with :wink:

[~/dev/rails/external/mongrel/pkg/mongrel-1.1.2]$ gem build mongrel.gemspec
WARNING: no email specified
WARNING: no homepage specified
WARNING: bin/mongrel_rails is missing #! line
ERROR: While executing gem … (TypeError)
can’t convert YAML::JvYAML::Map into String

Regards,


Luis L.
Multimedia systems

A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams