Exit Print View

Sun GlassFish Enterprise Server v3 Scripting Framework Guide

  This Document Entire Library
Print View

Document Information

Preface

1.  Using JRuby on Rails With Sun GlassFish Enterprise Server

Introduction to JRuby and Rails on Sun GlassFish Enterprise Server

What Is Ruby on Rails ?

What Is JRuby ?

JRuby on Rails, the Sun GlassFish Enterprise Server v3, and the GlassFish v3 Gem

Installation and Configuration of JRuby

To Install JRuby and Rails from Update Center

To Install JRuby as Standalone

To Install Rails Gem on JRuby

Enterprise Server v3 JRuby Container Configuration

Configuring JRuby Container Through Asadmin CLI

Configuring JRuby Runtime Pool

Configuring JRuby Container Through Administration Console

To Configure JRuby Container from Administration Console

Creating a Simple Rails Application

To Create the hello Application

To Create the Controller and the View

To Pass Data From the Controller to the View

To Use Rails Without a Database

Deploying and Running a Rails Application

To Deploy the Rails Application as a Directory

Accessing a Database From a Rails Application

To Set Up the MySQL Database Server

To Create a Database-Backed Rails Application

Accessing Java Libraries From a Rails Application

To Create the Rails Application That Accesses Java Libraries

To Create the Views That Display the Images Generated by Java2D Code

To Add Java2D Code to a Rails Controller

To Run a Rails Application That Uses Java 2D Code

Monitor Rails Applications on Enterprise Server v3

Monitoring for JRuby Container

Viewing JRuby Container Statistics

GlassFish v3 Gem

To Install the GlassFish v3 Gem

To Run a Rails Application on GlassFish v3 Gem

To Deploy and Run the Database-Backed Web Application

Using GlassFish v3 Gem CLI

Introduction to Warbler

What Is Warbler ?

Creating and Deploying a Simple Rails Application with Warbler

To Create a Rails Application

To Deploy the WAR File

Further Information

2.  Developing Grails Applications

3.  Jython on Django

4.  Scala and Lift

5.  PHP

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.

To 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/