JRuby Newbie - Migrating from Ruby to JRuby


#1

Group,

I’m in a Java shop that uses scripts when we need something done
fast. My CTO is a PHP guy, but I’ve been nudging us towards using
Ruby for the last 6 months. Recently I needed a script that parsed
some xml and put the data in the MySql database, and I knocked it out
in Ruby. It worked great on my box, but in production we didn’t have
all the mysql pieces installed to use the mysql from ruby. After
struggling for a day and a half, I just rewrote it in PHP.

However, I would like to be able to write it in Ruby and deploy it as
a Java application. If not for this instance, then certainly the next
time.

This script used

  • dbi for mysql
  • ftools
  • find
  • zip/zip
  1. How do I find out if the libraries I need are available in JRuby?

  2. What is a good way to package my JRuby application?

  3. What kinds of things should I be on the lookout for?

I know this is a big-ish question. You can reply off list if you’d
like.

Thanks,
Joe


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

My best stab for you :wink:

  1. Just try them and see what does not work. JRuby has gems, etc.
    Most things will likely work, or have jruby versions. Big things like
    ActiveRecord are there, so the Mysql should be possible. If not you
    have great access to JDBC for any db stuff.

  2. Look at RAWR I believe.

  3. Anything with a “C” extension, but that is not to say in all
    cases. Most if not all ruby stuff should just work. JRuby is a
    marvelous feature full ruby environment. To be cliche, “Don’t worry,
    be happy”

On Wed, Apr 8, 2009 at 9:40 AM, Bothari removed_email_address@domain.invalid wrote:

However, I would like to be able to write it in Ruby and deploy it as

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

#3

Hi Joe,
i have incorporated something like a script console into my all java
apps. Basicaly it’s just jsr 223 that runs jruby scripts that you can
enter into text field. It turns out to be perfect solution for “fast”
things, but after some time it was extended to other stuff that fits
better for dynamic solutions - mainly complex configuration. So as for
using jruby just go ahead, it’s woth it this or that way.

Best greetings,
Pawel Wielgus.

2009/4/8, Matt M. removed_email_address@domain.invalid:

  1. Just try them and see what does not work. JRuby has gems, etc.
  1. How do I find out if the libraries I need are available in JRuby?

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

I recently implemented some servlet filter code using jRuby. This page
was
extremely useful… the RubyLauncher class fit my needs well:

http://wiki.jruby.org/wiki/Direct_JRuby_Embedding

Matt