Tuesday May 15, 2007
Ruby-on-Rails Hello World on GlassFish
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:rails hello_demo" command as
well.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/goldspikeruby script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/goldspikevendor/plugins/goldspike" directory in your
application directory. This plug-in's purpose is to WAR'up a RoR
application.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. 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 jruby ruby
Posted by Arun Gupta in web2.0 | Comments[10]
|
|
|
|
Today's Page Hits: 7046
Posted by Arun Gupta's Blog on May 16, 2007 at 03:22 PM PDT #
Posted by John Stanford on June 10, 2007 at 09:41 AM PDT #
Posted by Arun on June 10, 2007 at 05:04 PM PDT #
Posted by Amit on June 13, 2007 at 05:01 AM PDT #
Posted by Arun on June 13, 2007 at 08:53 AM PDT #
Posted by Arun Gupta's Blog on August 07, 2007 at 09:59 AM PDT #
Posted by Arun Gupta's Blog on August 08, 2007 at 09:46 AM PDT #
Hello. Thank you for your work. I am trying to follow the posted instructions for installing the Goldspike and unfortunately it does not work. I have NetBeans 6 M10 installed on Windows XP and when I execute the following command:
C:\Program Files\NetBeans 6.0M10\ruby1\jruby-1.0\bin>jruby script/plugin install svn://rubyforge.org/var/svn/jruby-extras/trunk/rails-integration/plugins/goldsp
ike
I get the following error:
Error opening script file: script\plugin (The system cannot find the path specif
ied)
SVN client is installed.
Would you know what a solution to this issue might be? Thank you!
Eugene
Posted by Eugene on August 23, 2007 at 06:49 AM PDT #
Just found a solution to my problem. Simple really.
This was done with
Product Version: NetBeans IDE 6.0 M10 (build 200706281431)
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\xyz\.netbeans\6.0m10
Create a Rails application in NetBeans
Right click on the created Rails app and select "Rails plugins"
Click on "Repositories" tab
Click on "Add URL"
In the pop-up window enter "http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/plugins" and click OK
Wait for the repository to load
Select the newly loaded repository
Click on the "New Plugins" tab
Wait for the list of plugins to load
Select "goldspike: http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/plugins/goldspike/" plugin and click install
Click OK in the pop-up window
Wait for installation to finish
Close two pop-up windows
now use Arun Gupta's instructions (http://blogs.sun.com/arungupta/entry/ruby_on_rails_hello_world)
# 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.
# 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.
Note: if you get an error regarding being unable to delete "rake-t", then using windows explorer navigate to "path to your RoR project\nbproject\private" and renate rake-t file to rake-t.old. Try "Refreshing Target List" again.
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.
Note: war file will be created in "path to your RoR project" directory
# Drop this WAR file in "domains/domain1/autodeploy" directory of your GlassFish instance and you are done!
Note: app can be accessed via:
http://myglassfishserver.myserver.com:8080/NameOfMyRailsApplication/controller/method
Posted by Eugene on August 23, 2007 at 07:32 AM PDT #
Eugene, This is exactly what is shown at:
http://blogs.sun.com/arungupta/entry/screencast_web6_first_jruby_app
Posted by Arun Gupta on August 23, 2007 at 08:11 AM PDT #