What is Ruby on Rails?

Ruby is an interpreted, dynamically-typed, object-oriented programming
language. It has a simple, natural syntax that enables developers to create
applications quickly and easily. It also includes the easy-to-use RubyGems
packaging utility for customizing a Ruby installation with additional plug-ins.

Rails is a web application framework that leverages the simplicity of
Ruby and eliminates much of the repetition and configuration required in other
programming environments. With Rails, you can create a database-backed web
application, complete with models and tables, by running a few one-line commands.

What is JRuby?

JRuby is a JavaTM implementation of the Ruby interpreter.
While retaining many of the popular characteristics of Ruby, such as dynamic-typing,
JRuby is integrated with the Java platform. With JRuby on Rails, you get the
simplicity and productivity offered by Ruby and Rails and the power of the
Java platform offered by JRuby, thereby giving you many benefits as a Rails
developer, including these:

You can access the rich set of Java libraries from your Rails
application.

You can use the powerful and secure support of Java Unicode
strings with your Rails application.

Your JRuby on Rails application can spin off multiple threads
because JRuby uses Java threads, which map to native Ruby threads. Furthermore,
you can pool these threads.

You have two options for deploying a Rails application on the Sun GlassFish:

Deploy the application as a directory to the Sun GlassFish Enterprise Server v3 Prelude by
using the asadmin command.

Deploy the application as a directory to the GlassFish v3
Gem installed on your JRuby virtual machine.

A Gem is a Ruby package that contains a library or an application. In
fact, Rails itself is a Gem that you install on top of JRuby.

One way to work with JRuby on Sun GlassFish is to install the GlassFish
v3 Gem on top of your JRuby installation. The GlassFish v3 Gem is just a lightweight
version of the Sun GlassFish Enterprise Server v3 Prelude and a Grizzly connector
for JRuby.

When you install the Gem, you have a Sun GlassFish instance embedded
in the JRuby virtual machine. This gives you a more complete development and
production environment because you have everything you need for JRuby on Rails
applications running inside the JRuby virtual machine in addition to everything
you need from the Sun GlassFish to create web applications.