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

ProcedureDeploying and Running the Database-Backed Web Application

With this task, you will deploy the books application to the GlassFish v3 Gem. You can alternatively deploy it to your regular Enterprise Server using directory-based deployment, as described in Deploying a Rails Application as a Directory.

  1. Go to <JRUBY_HOME>/samples/books.

  2. Deploy the application to the GlassFish v3 Gem by running the following command:

    jruby -S glassfish_rails books
  3. Run the application in your web browser using the following URL:

    http://localhost:3000/books

    The opening page says “Listing books” and has an empty table, meaning that there are no book records in the database yet. To add book records to the table, do the next step.

  4. Add records to the table by clicking the New book link on the index.html page.

  5. Enter the data for book on the new.html page and click Create.