The Source for Java Technology Collaboration
User: Password:



Arun Gupta

Arun Gupta's Blog

Ruby-on-Rails Hello World on GlassFish

Posted by arungupta on May 15, 2007 at 03:03 PM | Comments (1)

UPDATE: Simplified steps for GlassFish V2 are available here and for V3 here.

Ashish described how to create RoRaWAR (Ruby on Rails as Web ARchive). I decided to try these instructions on GlassFish V2 b46. Here are the steps I followed:

  1. Create a simple "Hello World" RoR application using NetBeans 6.0 M9 following this screencast. NetBeans IDE creates a standard Rails application for you which can be easily created using "rails hello_demo" command as well.
  2. Install the "goldspike" (nee rails-integration) plug-in by giving the following command:

    script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/goldspike

    On a Windows machine, this command can be invoked as:

    ruby script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/goldspike

    The correct installation of this plug-in can be confirmed by checking for the presence of "vendor/plugins/goldspike" directory in your application directory. This plug-in's purpose is to WAR'up a RoR application.
  3. After the plug-in is installed, right-select the NetBeans project, select "Run Rake Target", select "Refresh Target List". This will add a new category, "war", of rake targets. Select "war", "standalone", "create" to create a stand-alone WAR file. This is equivalent to invoking the command "rake war:standalone:create". This will archive the Rails framework libraries in the WAR file.
  4. Drop this WAR file in "domains/domain1/autodeploy" directory of your GlassFish instance and you are done!

This is really simple. I'll add database interaction in this app and report back.

Read more on Rails Integration with JavaEE servers.

Technorati: glassfish rubyonrails ror netbeans


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first)

  • This almost like 85% installation/configuration/setting up time and 15% coding time !

    Ruby is considered the 5th programming generation languages - but they better do something about the running part.

    Posted by: anjanesh on May 16, 2007 at 01:26 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds