You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
john_brock edited this page Jan 6, 2011
·
2 revisions
I am using Eclipse and Maven for a number of Java projects. For our development we use "Run Jetty Run" to launch a Jetty servlet really quickly. I'd like to use this combo for JRuby + Rails development - leveraging many of the benefits of these tools that I've worked hard on learning.
0 - Initial Setup
create a test project
create a test rails app
create a pom.xml in your test project
1 - Run Jetty Run
If you don't have it and want to try - you can add the site (and install) to your Eclipse feature sites
4 - Copy (symlink) over your Rails app. I'd prefer to put it into a subdirectory rather than just toss into the webapp dir. So make a subdir like "WEB-INF/rails" and toss your entire rails app in there. You can change the name of this directory in the web.xml file - look for "rails.root"
So you'll have a directory structure like:
src/main/webapp/WEB-INF/rails/app
src/main/webapp/WEB-INF/rails/config
src/main/webapp/WEB-INF/rails/db
etc.
plus
src/main/webapp/WEB-INF/web.xml
5 - Adding your gems
Put them in "src/main/webapp/WEB-INF/gems". Make sure this directory exists before using the commands:
plus add your own
6 - Create your Run Jetty Run configuration
Open Eclipse's Run Dialog
Add a new "Jetty Webapp"
Set the project to this Test Project
Set the context to something you like like jrails
Set the WebApp dir to "src/main/webapp"
Apply
Run
7 - You should be able to point your browser to http://localhost:8080/jrails/
8 - Watch your console - debug ad naseum - amend these instructions
9 - Use Maven to make your WAR file when ready
mvn clean war:exploded
or
mvn clean war:war
I just figured this out - so I haven't used the config extensively. As I discover more things I will come back and put in debugging tips.