I have already managed to run an example of JRuby on Rails in Tomcat with PKI at work. So what I need next was an application development environment and I’ve got JRuby on Rails running on Tomcat inside Eclipse IDE with Eclipse WebTools Platform and Aptana’s RadRails plugin.
I already have a Tomcat package coupled with JASS (Java Authentication and Authorisation Service) framework at work, which works nicely within Eclipse IDE with WTP. So, I just needed to install RadRails as a plugin to that. I can only use RadRails to develop a Rails app, but can’t run it in WEBrick because it calls Java JASS API functions to get out other information about the user. However, you can add it to a Tomcat server as an external web module (you can’t add this as a web module because it’s not a web project, but a rails project) so that you can run the Rails app with JRuby in Tomcat within Eclipse! Here is a short instruction.
- Download the Eclipse + WTP all-in-one package
- Install RadRails and configure it
- Create a new Rails project
- Create a WEB-INF folder with necessary files in the root of the project
- Create a new server (e.g. Tomcat)
- Add the Rails project as an external web module to the server. You just point the directory where the Rails project resides in and give a path like /projectname.
- Start the server
- Open a browser in Eclipse and access the webapp (screenshot)