This procedure explains how to download and install JRuby and then configure it to work with GlassFish Server. If you prefer to use the GlassFish Server Update Tool to install JRuby directly on GlassFish Server, use the procedure in To Install JRuby and Rails Using Update Tool instead.
Download the desired JRuby package from the JRuby Downloads page and save it in the location of your choice.
Packages are available in a variety of formats, including tar.gz, ZIP, Windows executable, and JAR.
Unpack the JRuby package in the directory of your choice.
For the purposes of this procedure, the directory in which you unpack the JRuby package is referred to as jruby-install.
Set the JRUBY_HOME environment variable to the location of your JRuby installation.
Add JRUBY_HOME/bin directory to your system path.
Perform the following additional steps to configure the JRuby installation to work with GlassFish Server.
Install the required Rails Gems for standalone JRuby operation.
jruby -S gem install rails
The -S parameter tells JRuby to look for the install rails script anywhere in the JRUBY_HOME path.