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

Introduction to JRuby and Rails on the Sun GlassFish

This section gives you an overview of JRuby and Rails on the Sun GlassFish by explaining the following concepts:

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.

To learn more about Ruby on Rails, see Ruby on Rails.

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:

To learn more about JRuby, see JRuby.

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

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:

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:

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.