July 8, 2020
Hot Topics:

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

  • By Dominic Da Silva
  • Send Email »
  • More Articles »

You also can clean all temporary WAR files by running the command:

jruby -S rake tmp:war:clear

Copy the railswartest.war file to the /opt/tomcat/webapps directory:

Click here for a larger image.

Figure 18: Copying the railswartest WAR file to the Tomcat webapps directory

Start up Tomcat; you should be able to point your browser to http://localhost:8080/ and see the Rails welcome page:

Click here for a larger image.

Figure 19: Starting up the Tomcat server

Click here for a larger image.

Figure 20: The railswartest app Rails welcome page running on the Tomcat server

Now, test the CRUD for the guitars table. Point the browser to http://localhost:8080/guitars; you should see an empty guitar list. You now can do some simple CRUD operations on the guitars table to test your app. What is happening under the covers is really exciting. Your JRuby on Rails app is running on Tomcat and is using JDBC to perform CRUD actions on the guitars table! The following screenshots show some CRUD operations on the guitars table:

Click here for a larger image.

Figure 21: Empty guitars table

Page 6 of 8

This article was originally published on July 31, 2007

Enterprise Development Update

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

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