Running Merb on JRuby 1.2 and Glassfish 2.1
by Carl Mercier
So I’ve been trying to get Merb running on JRuby a good part of last night. I don’t know jack about Java, so this has been a little bit more challenging than it should have been. Most (if not all) of the tutorials I found were old and obsolete, so I decided to throw out my very own.
I need to give credit to this page, without which I’d still be fighting with this whole thing.
This tutorial uses JRuby 1.2, Glassfish 2.1, Merb 1.0.10 and Ubuntu 8.04 LTS. To make my life easy, I simply fired an EC2 instance based on ami-71fd1a18. I recommend you do the same. However, it should work from just any vanilla Ubuntu 8.04.
Some important comments are in the script below, make sure to read them. Enjoy!
Thanks for the wonderful blog entry!
Alternatively Merb applications can run using the GlassFish Gem as described at:
http://blogs.sun.com/arungupta/entry/getting_started_with_merb_using
and
http://blogs.sun.com/arungupta/entry/totd_53_scaffold_in_merb
Arun,
That’s some pretty nifty stuff that you have there, thanks!
Thanks, feel free to use it in any manner!
How do you plan to use GlassFish and Merb together ?
We don’t have any real plans yet, but we’re considering moving Defensio to JRuby for the real threads. Datamapper is a show stopper for us right now though. So this is still just a big experiment. Still good to play with technology and know what your options are imo!
Ok, thanks!
Feel free to give your GlassFish related feedback at users@glassfish.dev.java.net or JRuby feedback at user@jruby.codehaus.org. Or post a comment on my blog
I got bunch of Merb related entries at: http://blogs.sun.com/arungupta/tags/merb
while you might end up needing some of what you discovered when you actually deploy, but +1 using glassfish v3 gem for development … you just type glassfish from the base directory of the rack app and well, that’s it …
I’m not linux advanced user and I get that error when following instructions from article.
marek@marek-desktop:~$ jruby -S merb help
jruby: No such file, directory, or command — merb
marek@marek-desktop:~$ jruby -S rails hello_app
:1: /usr/bin/rails:4: , unexpected ‘=’ (SyntaxError)
marek@marek-desktop:~$ which gem
/opt/jruby/bin/gem
marek@marek-desktop:~$ gem environment
RubyGems Environment:
– RUBYGEMS VERSION: 1.3.1
– RUBY VERSION: 1.8.6 (2009-03-16 patchlevel 287) [java]
– INSTALLATION DIRECTORY: /var/lib/gems/1.8
– RUBY EXECUTABLE: /opt/jruby/bin/jruby
– EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
– RUBYGEMS PLATFORMS:
– ruby
– universal-java-1.6
– GEM PATHS:
– /var/lib/gems/1.8
– /home/marek/.gem/jruby/1.8
– /opt/jruby/lib/ruby/gems/1.8
– GEM CONFIGURATION:
– :update_sources => true
– :verbose => true
– :benchmark => false
– :backtrace => false
– :bulk_threshold => 1000
– “install” => “–env-shebang”
– “update” => “–env-shebang”
– :sources => ["http://gems.rubyforge.org/", "http://gems.github.com/", "http://gems.github.com"]
– REMOTE SOURCES:
– http://gems.rubyforge.org/
– http://gems.github.com/
– http://gems.github.com
Any idea what could I do ?