Using RJB in a Rails 3 app?

I’m trying to interact with a java library (Aspose Slides) inside of my Rails 3 app. I’m trying to get the rjb gem installed but I keep running into the same error when I try to start the app:

[BUG] cross-thread violation on rb_gc()

(null)

Abort trap

I’m on OSX 10.6.6, running ruby 1.8.7-p174 (via RVM) and Rails 3.0.4. I tried a couple of methods for getting this to work on OSX with the first one being the official rjb page:

http://rjb.rubyforge.org/

I also tried the “RJB Setup” section in this article as well, same error though:

http://www.brandonmartinez.com/2010/03/13/tutorial-setting-up-itext-rjb-in-mac-os-x/

Thanks for any help!

Hi There,

Just trying to get a sense who is running Rails 3 on JRuby and in general how good the experience in. Generally I'm just deploying to Heroku, but I have some Java shops I work with that have an interest in war based deployment of Rails apps. How's the gem compatibility on the whole? Any other obvious gotchas assuming you're already comfortable with the world of Java?

Best Wishes,
Peter

Thanks but I’m really just interested in getting RJB working with my Rails 3 app…can’t seem to get past the error I posted though.

FYI to my future self and anyone else that might benefit…I was able to get RJB 1.3.2 working after installing
Java for Mac OS X 10.6 Update 3 Developer Package and performing the following:

cd /System/Library/Frameworks/JavaVM.framework/Versions

sudo rm -f CurrentJDK

sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents CurrentJDK

This link was helpful too:

http://rubyforge.org/forum/forum.php?forum_id=38127