October 16, 2018
Hot Topics:

JRuby on Rails with Nine Lives: Running a JRuby on Rails Application on Tomcat

  • July 31, 2007
  • By Dominic Da Silva
  • Send Email »
  • More Articles »

Now, create your scaffold for your Guitar Ruby class that Rails will use to manage your guitars table. Run the following command:

jruby script/generate scaffold Guitar

Click here for a larger image.

Figure 14: Generating the Guitar class scaffold

Testing the Rails Application Using WEBrick

Now that you have everything you need to do CRUD operations on our guitars table, give your app a quick test run using Ruby's WEBrick server. You run the following command to start WEBrick and point your browser to http://localhost:3000/guitars:

jruby script/server

Click here for a larger image.

Figure 15: Running the railswartest app using the WEBrick server

Click here for a larger image.

Figure 16: The railswartest app running on the JRuby WEBrick server

Installing Tomcat

I assume you already have Apache Tomcat installed. If not, you can download it and uncompress it to your desired installation directory. I am using Tomcat version 5.5.17; it is installed to the /opt/tomcat directory.

Creating the WAR File and Deploying It to Tomcat

To create a WAR file of your railstestwar app, run the following command:

jruby -S rake war:standalone:create

Click here for a larger image.

Figure 17: Creating the railswartest WAR

Page 5 of 8

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date