Oracle GlassFish Server 3.0.1 Scripting Framework Guide

ProcedureTo Install JRuby in Standalone Mode

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.

  1. 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.

  2. 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.

  3. Set the JRUBY_HOME environment variable to the location of your JRuby installation.

    For example:


    export JRUBY_HOME=jruby-install
    
  4. Add JRUBY_HOME/bin directory to your system path.

    For example:


    export PATH=$PATH:$JRUBY_HOME/bin
    
  5. Perform the following additional steps to configure the JRuby installation to work with GlassFish Server.

    1. Change to the GlassFish Server bin directory and start the GlassFish Server domain.

      For example:


      cd as-install/glassfish/bin
      ./asadmin start-domain domain-name
      
    2. Specify the JRuby home directory:


      ./asadmin configure-jruby-container --jruby-home=jruby-install
      
  6. 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.