Oracle GlassFish Server 3.0.1 Scripting Framework Guide

ProcedureTo Install JRuby and Rails Using Update Tool

This procedure explains how to install JRuby and JRuby Gems (including Rails) directly on top of an existing GlassFish Server installation using the GUI-based Update Tool.

Before You Begin

GlassFish Server must be installed and running before proceeding with these instructions.

In these instructions, the root GlassFish Server installation directory is referred to as as-install.

  1. In a command shell for your operating system, change to the as-install/bin directory and run the updatetool command.

    Tip –

    If you are running Update Tool from behind a firewall that implements a proxy server, you may need to set the HTTP_PROXY environment variable before running the updatetool command. For example, in a Solaris/Linux Bash shell:

    export HTTP_PROXY=http://proxy-server:port

    If this is the first time you have launched updatetool, the full Update Tool product will not yet be installed, and you are prompted to allow installation to proceed.

    1. Type y when prompted to install Update Tool.

      The installer downloads and installs the full Update Tool product and then exits.

    2. Type the updatetool command again to launch Update Tool.

    The Update Tool main window is displayed, with Available Updates highlighted.

  2. Select the JRuby on GlassFish and JRuby Gems packages from the list of Available Add-Ons, and then click Install to install the packages.

    The contents of the JRuby on GlassFish and JRuby Gems packages are as follows:

    • JRuby on GlassFish – Contains JRuby 1.3.1

    • JRuby Gems – Contains Rails 2.3.2, Warbler, jdbc-mysql, and activerecord-jdbcmysql-adapter packages.

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

    By default, when installed using Update Tool, JRuby is installed in a subdirectory below as-install/glassfish. The commands to set JRUBY_HOME will typically be as follows:

    • Solaris/Linux:

      export JRUBY_HOME=as-install/glassfish/jruby
    • Windows:

      set JRUBY_HOME=C:\as-install\glassfish\jruby
  4. Add the JRUBY_HOME/bin directory to your system path.

    For example:

    • Solaris/Linux:

      export PATH=$PATH:$JRUBY_HOME/bin
    • Windows:

      set PATH=%JRUBY_HOME%\bin;%PATH%
  5. Proceed with the JRuby container configuration instructions in Configuring JRuby for GlassFish Server.