Stephanos,
Usually you’d just setup a ruby project (maybe using rails, sinatra, or
whatever if webapp), and then assuming you’re making a webapp, use
warble to package it up in a war.
In that war, it would have your jruby files (.rb files) and the jruby
jar, jruby-rack jar at least, and if you wanted (but don’t have to)
other jars in the WEB-INF/lib so that your JRuby code could call other
custom java classes. The gems, etc. all packaged up as .rb files as well
just like a ruby on rails, sinatra, etc. project. Warble puts all that
into the war. And Jruby is compiling ruby code at runtime. I probably
just butchered that description. I’d point you at the JRuby wiki at
Kenai but at the moment I just clicked on it, it is just sitting there,
so I assume it is down or being restarted:
http://kenai.com/projects/jruby/pages/Home
You can also call JRuby from other java code, etc. I’ve not done it, so
I can’t say much about it. See
I came from a background of originally using Ant quite a bit (although
did some Maven 1 many years ago) and then was heavy into Maven 2 before
I got into JRuby/Ruby. So at first I also thought, “Can’t I just throw a
pom.xml together and build a JRuby project?” But, that isn’t the way you
probably want to go. You probably want to learn Ruby first. You might
even just try Ruby on Rails or a basic Ruby/Sinatra app first outside of
JRuby, and then after you do that, do the same in JRuby and use warbler
to deploy a war that you could host in Tomcat (for example). You don’t
have to start that way (I didn’t), but if I was to do it over again, I
might.
Note also that JRuby is not just about calling your custom Java classes
or reusing the myriad of Java libraries out there. Except for Ruby gems
that use C-extensions (which you used to be able to check at
http://isitjruby.com/ but at the moment it appears to be a default
“Joyent Accelerator” page), most of the gems, etc. available to Ruby can
be used in JRuby. I think it is easier to use Ruby from within JRuby
than calling/instantiating Java, even though it is plenty easy to use
Java from JRuby as well.
But I may be way off. What were you aiming to do?
Hope this helps,
Gary
On Apr 23, 2010, at 11:07 AM, stephanos wrote:
Sent from the JRuby - User mailing list archive at Nabble.com.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email