Can't install Merb 1.0 gems using JRuby

59 views
Skip to first unread message

Vivek Pandey

unread,
Nov 8, 2008, 9:43:58 AM11/8/08
to me...@googlegroups.com
I just tried to install Merb 1.0 on my mac using jruby 1.1.5 (latest) but see the same error related to native extension.

Any workaround that I can use to get past this?

thanks,

-vivek.

gem install merb --backtrace --debug
Exception `LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:38 - #<LoadError:0x4db085>
Exception `Gem::LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems.rb:636 - #<Gem::LoadError:0x8f110d>
Exception `Gem::LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:38 - #<Gem::LoadError:0x8f110d>
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Exception `LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:38 - #<LoadError:0xcb191>
Exception `Gem::LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems.rb:636 - #<Gem::LoadError:0x5dae4f>
Exception `Gem::LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems.rb:636 - #<Gem::LoadError:0x8fc07d>
Building native extensions.  This could take a while...
/tools/jruby-1.1.5/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (NotImplementedError)
    from /tools/jruby-1.1.5/lib/ruby/1.8/mkmf.rb:21:in `require'
    from extconf.rb:21
Exception `Gem::InstallError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb:51 - #<Gem::InstallError:0xf75a71>
Exception `Gem::Installer::ExtensionBuildError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems/installer.rb:502 - #<Gem::Installer::ExtensionBuildError:0xaf655e>
ERROR:  Error installing merb:
    ERROR: Failed to build gem native extension.

/tools/jruby-1.1.5/bin/jruby extconf.rb install merb --backtrace --debug


Gem files will remain installed in /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6 for inspection.
Results logged to /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/ext/gem_make.out
Exception `Gem::LoadError' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems.rb:636 - #<Gem::LoadError:0x838ae3>
Exception `Gem::SystemExitException' at /tools/jruby-1.1.5/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:144 - #<Gem::SystemExitException:0x19e78b>


Vivek Pandey

unread,
Nov 8, 2008, 9:48:21 AM11/8/08
to me...@googlegroups.com
A better looking stack trace, it is really with do_sqlite3-0.9.6. Would jdbcsqlite3 gem won't serve the purpose?

-vivek.

gem install merb -V

JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
GET 304 Not Modified: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 304 Not Modified: http://gems.rubyforge.org/specs.4.8.gz
Installing gem do_sqlite3-0.9.6
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/History.txt
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/LICENSE
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/Manifest.txt
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/README.txt
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/Rakefile
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/TODO
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/ext/do_sqlite3_ext.c
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/ext/extconf.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/lib/do_sqlite3.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/lib/do_sqlite3/transaction.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/lib/do_sqlite3/version.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/spec/integration/do_sqlite3_spec.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/spec/integration/logging_spec.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/spec/integration/quoting_spec.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/spec/spec.opts
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/spec/spec_helper.rb
/tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/spec/unit/transaction_spec.rb

Building native extensions.  This could take a while...
/tools/jruby-1.1.5/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (NotImplementedError)
    from /tools/jruby-1.1.5/lib/ruby/1.8/mkmf.rb:21:in `require'
    from extconf.rb:21
ERROR:  Error installing merb:
    ERROR: Failed to build gem native extension.

/tools/jruby-1.1.5/bin/jruby extconf.rb install merb -V



Gem files will remain installed in /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6 for inspection.
Results logged to /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/ext/gem_make.out

-vivek

Luis Lavena

unread,
Nov 8, 2008, 9:50:54 AM11/8/08
to me...@googlegroups.com
On Sat, Nov 8, 2008 at 11:43 AM, Vivek Pandey <vivek....@gmail.com> wrote:
> I just tried to install Merb 1.0 on my mac using jruby 1.1.5 (latest) but
> see the same error related to native extension.
>
> Any workaround that I can use to get past this?
>

"merb" gem add as dependency datamapper components, which includes
do_sqlite3. At this time do_sqlite3 has no Java implementation.

I think the datamapper dependency of merb should be removed and leave
merb alone. After all, some users will like to use ActiveRecord
instead.

--
Luis Lavena
AREA 17
-
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

Per Melin

unread,
Nov 8, 2008, 9:56:49 AM11/8/08
to me...@googlegroups.com
>> Any workaround that I can use to get past this?
>
> "merb" gem add as dependency datamapper components, which includes
> do_sqlite3. At this time do_sqlite3 has no Java implementation.

The merb gem is just merb-core, merb-more and datamapper. So by
installing merb-core and merb-more directly you get around the
problem.

Luis Lavena

unread,
Nov 8, 2008, 10:03:24 AM11/8/08
to me...@googlegroups.com

An datamapper defines do_sqlite3 as dependency, which end with this situation.

So again -- merb add datamapper as dependency, isn't the right statement?

Matt Aimonetti

unread,
Nov 8, 2008, 10:07:38 AM11/8/08
to me...@googlegroups.com
The Merb meta gem won't work with jRuby because of the DataMapper dependency.
jRuby users should install merb-core and what they need from merb-more.

Note that Glashfish works great with Merb, I personally gave it a try with wycats last night and it's pretty cool!

-Matt

Per Melin

unread,
Nov 8, 2008, 10:22:23 AM11/8/08
to me...@googlegroups.com
> Note that Glashfish works great with Merb, I personally gave it a try with
> wycats last night and it's pretty cool!

At least once you've googled the solution (i.e. run as root) to the
glassfish gem blowing up with "the domain directory is not writable"
when started, which is a bug that goes back to April.

https://glassfish.dev.java.net/issues/show_bug.cgi?id=4606

Something else:
Has anyone done any benchmarks? A simple hello world app is very slow
on my machine; about 1/5 of the req/s compared to MRI + Thin. But I'm
testing on 32-bit OS X which may not be the best environment for Java.

Yehuda Katz

unread,
Nov 8, 2008, 11:01:54 AM11/8/08
to me...@googlegroups.com
I did gem install glassfish and ran the glassfish binary in my app root. Everything "just worked".

Glassfish is in fact quite slow for a Hello World. However, it is capable of dealing with very high concurrency (I was able to throw as many concurrent requests as ab was able to handle), while thin dies at around 100ish. Additionally, jruby's threading model should be much better for real (i.e. non-hello-world) situations.

Finally, I was told by the JRuby guys that this release of grizzly (Ruby-Glassfish) has basically no performance tuning yet, so you should expect improvements in the future.

-- Yehuda
--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325

Per Melin

unread,
Nov 8, 2008, 11:22:54 AM11/8/08
to me...@googlegroups.com
> I did gem install glassfish and ran the glassfish binary in my app root.
> Everything "just worked".

It will "just work" if you have write permission to the directory
where the glassfish gem resides, which for many real world deployments
are not so.

> Glassfish is in fact quite slow for a Hello World. However, it is capable of
> dealing with very high concurrency (I was able to throw as many concurrent
> requests as ab was able to handle), while thin dies at around 100ish.
> Additionally, jruby's threading model should be much better for real (i.e.
> non-hello-world) situations.

And these are the reasons why we probably will end up deploying our
Merb projects on JRuby. But there will be many tests and benchmarks
before we take that decision.

Vivek Pandey

unread,
Nov 8, 2008, 9:47:39 PM11/8/08
to me...@googlegroups.com
I think I am making progress. Do I need any more merb gems? I installed merb-core and merb-more independently and they installed just fine:

vivek@shristy(553)> gem list merb*

*** LOCAL GEMS ***

merb-action-args (1.0)
merb-assets (1.0)
merb-auth (1.0)
merb-auth-core (1.0)
merb-auth-more (1.0)
merb-auth-slice-password (1.0)
merb-cache (1.0)
merb-core (1.0)
merb-exceptions (1.0)
merb-gen (1.0)
merb-haml (1.0)
merb-helpers (1.0)
merb-mailer (1.0)
merb-more (1.0)
merb-param-protection (1.0)
merb-slices (1.0)
merb_datamapper (1.0)


However,

merb-gen app myapp

Fails with this error, what I might be missing.

vivek@shisty(551)> merb-gen app myapp
Generating with app generator:
     [ADDED]  gems
     [ADDED]  tasks/merb.thor
     [ADDED]  .gitignore
     [ADDED]  public/.htaccess
     [ADDED]  tasks/doc.thor
     [ADDED]  public/javascripts/jquery.js
     [ADDED]  doc/rdoc/generators/merb_generator.rb
     [ADDED]  doc/rdoc/generators/template/merb/api_grease.js
     [ADDED]  doc/rdoc/generators/template/merb/index.html.erb
     [ADDED]  doc/rdoc/generators/template/merb/merb.css
     [ADDED]  doc/rdoc/generators/template/merb/merb.rb
     [ADDED]  doc/rdoc/generators/template/merb/merb_doc_styles.css
     [ADDED]  doc/rdoc/generators/template/merb/prototype.js
     [ADDED]  public/favicon.ico
     [ADDED]  public/merb.fcgi
     [ADDED]  public/robots.txt
     [ADDED]  public/images/merb.jpg
(erb):27:in `render': undefined local variable or method `testing_framework' for #<Templater::Actions::Template:0x51550e> (NameError)
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/actions/template.rb:49:in `eval'
    from /tools/jruby-1.1.5/lib/ruby/1.8/erb.rb:743:in `result'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/actions/template.rb:26:in `render'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/actions/template.rb:49:in `invoke!'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/actions/template.rb:49:in `open'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/actions/template.rb:49:in `invoke!'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/cli/generator.rb:102:in `step_through_templates'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/cli/generator.rb:84:in `each'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/cli/generator.rb:84:in `step_through_templates'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/cli/generator.rb:75:in `run'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/cli/manifold.rb:24:in `run'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/templater-0.3.5/lib/templater/manifold.rb:80:in `run_cli'
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/merb-gen-1.0/bin/merb-gen:6
    from /tools/jruby-1.1.5/lib/ruby/gems/1.8/gems/merb-gen-1.0/bin/merb-gen:19:in `load'
    from /tools/jruby/bin/merb-gen:19

-vivek.

Vivek Pandey

unread,
Nov 8, 2008, 9:50:39 PM11/8/08
to me...@googlegroups.com
We are fully aware of this bug and the fact that we mad eprogress but could not get dependency on domain directory. We definitely want to fix it as soon as we can, stay tuned...

-vivek.

Vivek Pandey

unread,
Nov 8, 2008, 9:53:06 PM11/8/08
to me...@googlegroups.com
Dependency on domain directory will be removed soon. I wish we could fix it in time. Apologies for the trouble it is causing.
We will have it soon:-)

Thanks for your interest in GlassFish.

-vivek.

Mark Watson

unread,
Nov 9, 2008, 12:33:50 AM11/9/08
to merb
I think that this is a bug with the current version(s) of JRuby's
Templater implementation.

Have you tried generating the project using Matz's Ruby, then running
Merb with JRuby?

Also, you will probably want to use ActiveRecord until DataMapper is
'JRuby ready'.

Matt Aimonetti

unread,
Nov 9, 2008, 3:52:52 AM11/9/08
to me...@googlegroups.com
You can't generate a normal merb app with jRuby because of datamaper.
You have to do merb-gen core app-name

Tonight wycats and I had a talk with the jRuby guys about getting a dm
driver working with jRuby. In the meantime, or if you are not
interesting in DM, activerecord works just fine.

Matt

Sent from my iPhone

Vivek Pandey

unread,
Nov 9, 2008, 10:27:31 AM11/9/08
to me...@googlegroups.com
On Sun, Nov 9, 2008 at 12:52 AM, Matt Aimonetti <mattai...@gmail.com> wrote:

You can't generate a normal merb app with jRuby because of datamaper.
You have to do merb-gen core app-name


Yeah, I tried it after seeing wycats tweet but the same error. I will try with jruby 1.1.4 and see how it goes.

Tonight wycats and I had a talk with the jRuby guys about getting a dm
driver working with jRuby.

Thats great!
 
In the meantime, or if you are not
interesting in DM, activerecord works just fine.

Yeah, I am at the first step, let me create the app then will enable activerecord thru init.rb (is this the right way to do it?) and see how it goes.

thanks,

-vivek.
 

Arun

unread,
Nov 10, 2008, 6:23:02 PM11/10/08
to merb
JRuby 1.1.4 has RubyGems 1.2.0 and Merb 1.0 needs RubyGems 1.3.0.

dudleyf on #jruby mentioned that there is a native dependency
introduce after 0.9.13 so I tried installing only "merb-core" as
"jruby -S gem install merb-core -v 0.9.13". I also had to install
"hoe". The installation went fine but creating an app as "merb-gen app
hello" or "merb-gen core hello" shows the help instructions.

What am I missing ?

On Nov 9, 7:27 am, "Vivek Pandey" <vivek.pan...@gmail.com> wrote:
> On Sun, Nov 9, 2008 at 12:52 AM, Matt Aimonetti <mattaimone...@gmail.com>wrote:
>
>
>
> > You can't generate a normal merb app with jRuby because of datamaper.
> > You have to do merb-gen core app-name
>
> Yeah, I tried it after seeing wycats tweet but the same error. I will try
> with jruby 1.1.4 and see how it goes.
>
>
>
> > Tonight wycats and I had a talk with the jRuby guys about getting a dm
> > driver working with jRuby.
>
> Thats great!
>
> > In the meantime, or if you are not
> > interesting in DM, activerecord works just fine.
>
> Yeah, I am at the first step, let me create the app then will enable
> activerecord thru init.rb (is this the right way to do it?) and see how it
> goes.
>
> thanks,
>
> -vivek.
>
>
>
> > Matt
>
> > Sent from my iPhone
>
Reply all
Reply to author
Forward
0 new messages