Developing and deploying your Rails application on the Sun GlassFish Enterprise Server gives you the following advantages over using a typical web server used for running Rails applications:
A simple, integrated deployment environment. In other words, you do not need one set of software for developing the application and another set of software for deploying it.
The ability to deploy multiple Rails applications to a single GlassFish instance.
The ability of a Rails application to handle multiple requests.
For more details on these and other advantages of using the GlassFish for your JRuby on Rails applications, see Advantages of JRuby-on-Rails with the GlassFish Application Server.
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.