views:

927

answers:

5

Hello, I am considering about what is the difference between JRuby on Rails and the original Ruby on Rails for my product?

How does it difference in development activity, deployment, support between its original, or scalability?

I have read many article. They said JRuby is the same function like Ruby. Does it mean we can use Ruby gems for JRuby, using scaffold and ActiveRecord like Ruby, and we can also deploy the product like Java?

A: 

Most, but not all, Ruby gems are also available for JRuby. Scaffold and ActiveRecord can definitely be used with JRuby. You won't find any RoR functionality that is missing from the JRuby on Rails.

With JRuby you can deploy your application as a standard WAR. If you do not know for sure if you want to use native Ruby or JRuby, I recommend that you use Netbeans IDE. With it you can easily switch from native Ruby to JRuby for Rails applications.

kgiannakakis
+1  A: 

JRuby is a full implementation of Ruby, they're the same but JRuby runs on the JVM. It scale very well because you can deploy it inside an application server like Glassfish or JBoss.

You can use Rails of course, there's only one configuration to do, the database adapter. You must install JDBC adapter for ActiveRecord, for example:

gem install activerecord-jdbcmysql-adapter

and in your database.yml

adapter: jdbcmysql

and you're done!

edit:

if you're interested there's a comparison between various Ruby implementations, http://www.infoq.com/presentations/seifer-ruby-vm-comparison and JRuby is one of the best implementation.

Luke
+2  A: 

Only gems written purely in Ruby will work under JRuby. Gems like RMagick or MySQL or (the standard implementation of) JSON that require C extensions will leave you out of luck in some cases and with alternatives like the JDBC MySQL and JSON-JRuby gems in other cases.

Jim Puls
+1  A: 

See my answer here

Also, this is a handy reference: Is It JRuby

Rob
A: 

You don't have to re-install all your gems for JRuby. All you have to do is to set the GEM_HOME environment variable to the path with your gems. Please also note, that JRuby doesn't support native extensions. So you'll have to find JRuby compatible replacements for gems that use native extensions.

lbadura