Rails powered by the GlassFish Application Server explains all the benefits of using GlassFish for developing and deploying your Rails applications. If you are using NetBeans 6.1 builds then you can deploy your Rails application directly on GlassFish v3 from within NetBeans IDE. No longer you need to have different development and deployment options.
This blog explains how to install a bleeding-edge GlassFish v3 plugin and use it to deploy your Rails app natively on GlassFish (no WAR or anything :). Let's get started! Note, this plugin is bleeding edge and will soon be released on the Beta Update Center.
- Install "GlassFish v3 TP2" plugin in NetBeans 6.1
- In NetBeans 6.1 IDE, go to "Tools", "Plugins" and click
"Settings". The following window is shown:
- Click on "Add" and specify the URL of Bleeding
Edge Update Center values as shown (copy from
Click on "OK". The updated "Plugins" window looks like:
Notice "Available Plugins" has changed from 58 to 140 as many more bleeding edge plugins are now available.
- Click on "Available Plugins" and search for "GlassFish"
in the top-right corner text box as shown below:
- Select "GlassFish V3 JRuby Integration" and "GlassFish V3
JavaEE Integration" plugin and click on "Install" as shown below:
Follow the instructions to install the plugin. The IDE needs to restart for successful plugin installation.
the restarted IDE, go to "Services" tab, right-click on
and select "Add Server...". Select "GlassFish v3 TP2" as shown below:
- Select "Next >", accept the license agreement and
click on "Download V3 Now..."
Click on "Download V3 Now...". This downloads the latest GlassFish v3 TP2 build and installs in "/Users/arungupta/GlassFish_V3_TP2" directory. This is only an interim build, final TP2 build will be available soon! The following screen is shown once GlassFish v3 is installed:
Click on "Finish". In 58 seconds, you downloaded and installed the entire GlassFish v3 app server, cool isn't it!
- In NetBeans 6.1 IDE, go to "Tools", "Plugins" and click on "Settings". The following window is shown:
- Create a Rails app and deploy on GlassFish V3
- In NetBeans IDE, in the "Projects" tab, right-click and
select "New Project...". Select "Ruby" in "Categories" and "Ruby on
Rails Applications" in "Projects" as shown:
Click on "Next".
- Now comes the cool part. Enter the application name and
select the recently installed GlassFish v3 as shown:
This is a brand new feature in the "GlassFish v3 TP2" plugin available only on "Bleeding Edge" Update Center. It'll soon replace the default GlassFish v3 plugin from the Beta Update Center.
Click on "Finish" to take all other defaults.
- On the newly created project, right-click and select
"Run" as shown:
- The default browser page "http://localhost:8080/" shows
up. Change the URL to "http://localhost:8080/HelloRails" and the
following page shows up:
- In NetBeans IDE, in the "Projects" tab, right-click and select "New Project...". Select "Ruby" in "Categories" and "Ruby on Rails Applications" in "Projects" as shown:
If any part of the tooling is not working or you have suggestions and improvement then please file bugs on IssueZilla ("serverplugins" component) and use "glassfish_v3" subcomponent. If any part of the runtime is not working, then please file bugs on Issue Tracker ("V3" component) and use "jruby" subcomponent.
Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.