Sun GlassFish Enterprise Server v3 Scripting Framework Guide

Deploying and Running a Rails Application

As described in JRuby on Rails, the Sun GlassFish Enterprise Server v3, and the GlassFish v3 Gem, you have two ways to deploy your Rails application on the Enterprise Server:

For more details on running the Rails application using GlassFish v3 Gem, see To Run a Rails Application on GlassFish v3 Gem. This section shows you how to deploy the hello application that you created in the previous section, as a directory with the asdmin CLI and how to access the application from your web browser. You can also use these same instructions to deploy a legacy Rails application.

ProcedureTo Deploy the Rails Application as a Directory

You can use directory-based deployment to deploy any Rails application to the Enterprise Server. To deploy the hello application to the Enterprise Server as a directory, do the following:

  1. Start the Enterprise Server with the following command:

    asadmin start-domain

  2. Change to the directory where you created the sample application. For example:

    /apps/jruby-apps/hello

  3. Deploy the hello application with asadmin command:

    asadmin deploy hello

    • If you want to use a JRuby instance different from the update installation or the instance you configured with configure-jruby-container command, you can use the following deploy time option:

      asadmin deploy --property jruby.home=/jruby-install-location

  4. Run the hello application using the following URL in your browser:


    http://localhost:8080/hello/