views:

3831

answers:

4

I'm looking to try out JRuby and JRuby on Rails. I'm having trouble finding information on what's difference between JRuby on Rails and Ruby on Rails.

What's the differences I need to look out for?

A: 

mostly it should work the same. in jRoR you can access stuff you wouldn't have in RoR. Usually its mainly a deployment concern.

However, if your RoR app uses native libraries that don't have an equivalent that runs on the JVM, that can be a pain. However most libs have a non native version available (at least the popular ones I have come across).

Michael Neale
+24  A: 

JRuby is the ruby implementation that runs on JVM (Matz's ruby is C implementation). The main differences are

  1. Jruby runs on Java VM and it's either compiled or interpreted down to Java byte code.
  2. JRuby can integrate with Java code. Let's say if you have java class library (.jar), you can reference and use classes from that library within ruby code if you use JRuby. On the other hand, you can also call Jruby code from java as well. JRuby can also take advantage of the JVM and application server.
  3. JRuby is usually hosted within Java application server such as Sun's glassfish or even Tomcat web server.
  4. You cannot use native ruby gem with JRuby. However, there are jruby implementation for most of the popular ruby libraries.

There are other differences, you can refer to jruby wiki http://wiki.jruby.org/wiki/Main_Page.

Cheers,

Teera

Thank you, that answers just about everything I was looking for. :)
epochwolf
oh, and it runs a bit slower than 1.9
rogerdpack
A: 

I may be wrong, but I think you can package a JRuby on Rails app in a way you can't do with normal RoR - look at Mingle or similar. Makes it possible to sell without dropping your pants / opening the komono.

That said, I'm not familiar enough with RoR packaging, so dont hold me to it :)

Nic Wise
A: 

Nic wise which ruby varaint do u use that u like the most jruby or ruby-c

alex