How to install JRuby module on Glassfish v2 Install Glassfish v2 from here. Let's refer to the GlassFish installation directory as $GLASSGISH_ROOT Getting started guide for Glassfish v2 can be found here Install JRuby module from Glassfish update center Run the updatetool to install JRuby on Glassfish module
$GLASSFISH-ROOT/updatecenter/bin/updatetool
Cannot resolve external resource into attachment. As you can see above, the current version of Glassfish v2 JRuby module is 2.1. Accept the license agreement to install this module. After the successful installation of this module, you would see a new directory jruby created under your GlassFish root directory. A screenshot of the directory structure after having installed the JRuby on GlassFish 2.1 module. Cannot resolve external resource into attachment. Note If you had already installed the previous 2.0 module, updatetool would inform that there is an update available. In this case go to the "Available Updates" section and select JRuby on GlassFish 2.1 module and install it. In this case the directory structure would be Cannot resolve external resource into attachment. Contents of the JRuby on GlassFish 2.1 module This JRuby update center module primarily consists of JRuby 1.0.3 and Goldspike revision 858. The JRuby 1.0.3 source bits that are part of this module, have been updated with the following gems :
Web application modes JRuby on GlassFish update center module bundles Goldspike and it supports the 2 modes - "Standalone" and "Shared", of deploying a RubyOnRails (ROR) application to a GlassFish application server instance. For this blog we would be using the directory deployment feature of GlassFish.
- "Standalone" mode implies that the resulting Web application archive (WAR) would be self contained, i.e. it would contain not only the application, but also the JRuby, Rails, Goldspike libraries.
- "Shared" mode implies that the WAR would just contain the WEB-INF/web.xml file along with the application. The libraries required for the application to run successfully would be picked up from the classpath of the GlassFish application server instance.
Post Installation steps If you plan to use the "Shared" mode you would have to perform one additional step. After the successful installation of the JRuby update center module copy the required libraries to the GlassFish library directory and restart the GlassFish application server instance (for these libraries to be picked up by the running instance). Run the following command to achieve this :
ant -f $GLASSFISH_ROOT/jruby/install.xml setup-shared-env
Sample Applications This module comes with 3 sample applications -
- HelloWorldRailsApp - a simple hello world application
- cookbook - sample created using instructions from O'Reilly OnLamp
- mephisto - version 0.7.3 of Mephisto blogging
In each of these sample application directory there is a file GLASSFISH_README, which provides information on how to deploy and run the application.
|