Skip to main content

JRuby and Rails on GlassFish v3 Prelude - An Overview

Posted by vivekp on November 6, 2008 at 6:29 PM PST

GlassFish v3 Prelude supports
deployment of Rails applications and also
other dynamic language based frameworks such as Grails, which is based
on groovy language.

The support for dynamic languages based frameworks on GlassFish v3
comes through it's modular and extensible architecture and support for
pluggable Containers. Rails and Grails are just different Container
which are also OSGi bundles that get plugged in to GlassFish v3. Read
on the overview of GlassFish v3 Prelude architecture in href="">Jerome's

The architecture diagram below shows how support for Ruby on Rails
is realized in side GlassFish v3 Prelude

jrubycontainer.png src=""
height="593" width="729">

Key features

  • Rails application deployment
    - natural Rails way, no packaging
    • asadmin deploy myRailsApp/
  • Choice to deploy as WAR also
    • JRuby -S install warbler
    • warble
    • asadmin deploy
  • Needs JRuby runtime to run
    the Rails application
    • Install JRuby runtime and
      ready-to-go set of gems (Rails, JDBC-MySQL adapter, warbler) from
      GlassFish v3 Update Center
      • glassfish-install/bin/updateool
      • alt="jruby-uc-small.png"
        height="456" width="640">

    • The simply deploy your
      Rails application on GlassFish
      • asadmin deploy
    • If you have your own JRuby
      installation with the set of required gems then you need to tell
      GlassFish where it is available. you can chose to do one of the
      • java
        -Djruby.home=/tools/jruby-1.1.5 modules/glassfish.jar
      • Edit domain.xml
        (glassfish-install/glassfish/domains/domain1/config/domain.xml) and add
        • <jvm-options>-Djruby.home=/tools/jruby-1.1.5</jvm-options>
  • Access to GlassFish v3
    JavaEE features
    • JDBC connection pool
      • See href="">
  • Host your JavaEE, Grails,
    JRuby/Rails applications side by side
  • Easier, scalable deployment
    • Rails is single threaded.
      GlassFish keeps JRuby runtimes in a pool, which can be configured based
      on the available resources to scale better
    • Read href="">here
      on how to configure JRuby runtime pool
  • href="">NetBeans
    6.5 RC2 supports development,
    deployment and debugging of Rails applications on GlassFish v3 Prelude

Now, go and get href="">GlassFish
v3 Prelude and start developing,
deploying your Rails applications on it:-) You may like to bookmark href="">JRuby
GlassFish wiki  for
details and if you have questions let us know through the href="">mailing list
or report an issue on the href="">issue

Related Topics >>