Getting Started With JRuby on Rails for Sun GlassFish Enterprise Server v3 Prelude

ProcedureDeploying a Rails Application as a Directory

You can use directory-based deployment to deploy any Rails application natively to the Sun GlassFish Enterprise Server. To natively deploy the hello application to the Enterprise Server:

  1. Set JRUBY_HOME property value to the path to your JRuby installation as the last line in one of the following files, located in the config directory of Enterprise Server your installation:

    • For Windows systems: asenv.bat

    • For Unix systems: asenv.conf

  2. Save the file.

  3. Edit <AS_INSTALL>/domains/domain1/config/domain.xmland add this entry inside element:

    <java-config>
    ...
    <jvm-options>-Djruby.home=<JRUBY_HOME></jvm-options>
    ...
    </java-config>

    Note –

    If GlassFish v3 JRuby IPS package was installed using update tool, then there is no need to set the jruby.home system property


  4. Start the server.

  5. Go to <JRUBY_HOME>/samples.

  6. Deploy the hello application with asadmin command from your Enterprise Server installation:

    <AS_INSTALL>/bin/asadmin deploy hello
  7. Run the hello application using the following URL in your browser:

    http://localhost:8080/hello/home/index