Sun GlassFish Enterprise Server v3 Prelude Troubleshooting Guide

Rails and JRuby FAQs

Should I Start an Enterprise Server Domain and Deploy My Application Into It, or Should I Use the glassfish_rails Gem?

To continue the question: I'm not sure what the second option does, or why I might choose one over the other.

Response: In a nutshell, a gem is an application runner. It can run your Rails application but nothing else. If you use the Enterprise Server v3 Prelude installation, start the domain and deploy. You can deploy several Rails applications (or Java EE applications even) concurrently with a different context root. This gives you access to different containers such as web and EJB and also to the Update Tool. Enterprise Server enables you to host not only multiple Rails applications, but also any other Java EE application.

If I Deploy an Application Using the glassfish_rails Gem, Can I Still Access the Administration Console?

No, the gem only runs Rails applications with no extensions or extra features. You must have Enterprise Server v3 Prelude with a web container to access the Administration Console.

Where in a Rails Application Structure Does Enterprise Server Look for jar Files to Add to the Classpath for That Application?

To continue the question: WAR files and exploded Java webapp directories have a WEB-INF/lib directory. Rails applications also have a lib directory, but this is for Ruby libraries. Where in a Rails application can I put application-specific jar files? Is there such a place, or must I place them in the domain/lib directory?

Response: Place them in the domain/lib directory, or in glassfish/lib. If those bundles are OSGi bundles, you should place them in the glassfish/modules directory. If you want to package your own set of jar files with the Rails application, instead of copying the jars in the glassfish/lib or glassfish/modules directory, you might want to use Warbler. The Warbler gem lets you package your own jars and creates a WAR file from your Rails applications.

Where Can I Find More Information About Rails Applications and Enterprise Server?

See the following:

What Options Are Available for Running JRuby With Enterprise Server?

JRuby applications can be deployed natively, without the use of the servlet container. Enterprise Server v3 Prelude can run JRuby applications directly on top of the servlet container. Warbler can also be used to deploy JRuby applications to the servlet container.

For screencasts related to JRuby and Enterprise Server, see the GlassFish screencasts page at Also see Getting Started With JRuby on Rails for Sun GlassFish Enterprise Server v3 Prelude.