johnny
johnny

Reputation: 19735

Does using JRuby mean a duplicate of Ruby on all applications?

For example, if I install Rails for regular Ruby, am I required to have a special install of Rails for JRuby? So that I have duplicates for everything?

Upvotes: 2

Views: 210

Answers (3)

Robert Brown
Robert Brown

Reputation: 11016

Some gems use non-FFI C extensions. These will not work under JRuby.

Some gems install differently, depending on the platform (e.g. Mongrel). In which case separate installs are required.

You can install Ruby and JRuby side by side and then compare gems as follows:

gem list --local
jruby -S gem list --local

Upvotes: 0

Josh Moore
Josh Moore

Reputation: 13548

The simple answer is yes. JRuby represents a separate installation of Ruby on your system so Gems must be installed on both JRuby and Ruby separately.

Upvotes: 3

tadman
tadman

Reputation: 211570

If you bundle your gems with your Rails application, and this can include Rails itself, then there's no requirement to have multiple installs.

Some gems come in a variety of platform specific flavors, such as for JRuby or Win32, which may make this impractical if the application is run on a mixed platform environment. While Rails does not appear to be branched this way, many others, especially those that bind tightly to Ruby, such as compiled extensions, do.

It's worth trying to bundle as many gems as possible with your application and using a frozen version of Rails to see how it works out, and tweak it as required.

Upvotes: 0

Related Questions