Skip to main content

JRuby Module 3.0 for for GlassFish v2 is out

Posted by vivekp on May 3, 2008 at 1:11 AM PDT

JRuby Update Center module 3.0 for GlassFish v2 is out. It has been tested to work with GlassFish v2 UR2.
The Update Center modules provide out of the box tested-on-GlassFish version of JRuby, Rails and other required gems.
For the GlassFish users it is very convinient just install the JRuby module from the GlassFish update center and start
writing the Rails applications.

Here are some details on this release of Update Centner Modules:

It is a major upgrade from the previous 2.1 version which came with JRuby 1.0.3 and Rails 1.2.6. The major upgrade
comes in forms of JRuby version 1.1.1, Rails version 2.0.2 and Warbler. You can use Warbler to create a WAR of the
Rails application on GlassFish v2. The UC module also provides ant scripts for shared mode, where JRuby and Goldspike
jars are installed on Glassfish v2 and you don't have to package any of these jars and the gems with JRuby. This will
result in to smaller Rails applications compared to the WAR files created by Warbler.

Rails 2.0.2 is not backward compatible with Rails 1.2.6 so samples form the previous JRuby UC module will not work
on this new ver 3.0.

JRuby and installed gem versions

  • JRuby 1.1.1
  • gems
  •             

    actionmailer (2.0.2)
    actionpack (2.0.2)
    activerecord (2.0.2)
    activerecord-jdbc-adapter (0.8)
    activerecord-jdbcmysql-adapter (0.8)
    activeresource (2.0.2)
    activesupport (2.0.2)
    jdbc-mysql (5.0.4)
    rails (2.0.2)
    rake (0.8.1)
    rspec (1.1.3)
    sources (0.0.1)
    warbler (0.9.5)
               

           

Installing JRuby UC Module 3.0

To install, cd to your GlassFish installation, and run

./updatecenter/bin/updatetool
. This will bring the window below:

gfv2-jruby-uc.png

Select JRuby On GlassFish checkbox and click Install. After it finishes, it will create jruby director inside the
GlassFish installation.

lsjruby.png

Run HelloWorldRailsApp sample

  • Start GlassFish v2
                    

    asadmin start-domain
                   

               
  • Inside your GlassFish installation,
    cd jruby/samples/HelloWorldRailsApp
  • Create a WAR file HelloWorldRailsApp.war by running warbler
    JRuby -S warble
  • Now Deploy the war file
    asadmin deploy HelloWorldRailsApp.war
  • Access http://localhost:8080/HelloWorldRailsApp/say/hello in your browser.

Above Warbler was used to create a standalone WAR file. Warbler packages all the required JARs and gems in the the WAR
file resulting in to large WAR size. You can as well use setup-shared-env target from jruby/build.xml from inside
the GlassFish installation. This will copy JRuby and Goldspike jars in to glassfish/lib directory. After this
instead of running Warlbe, simply run create-shared target inside the application this will create WEB-INF/web.xml inside your
Rails application. At the end simply run asadmin deploy yourRailsApp. For details see GLASSFISH_README.txt inside the samples.

Continue sending your feedback to the GlassFish WebTier forum
or to the mailing list. Report any bugs to the IssueTracker

Related Topics >>

Comments

Yaay, with latest versions in UC, it should be more usable to folks. In 3rd bullet of running the app, it should be "jruby" instead of "JRuby".