Recommend
If you like our work with RVM, please send us a Tweet about how much you
like it or recommend us on Coderwall. With love: wayneeseguin, mpapis, envygeeks, richo, rmichael, rys, dkahoe, cwgem, ddd, lemoinem
IRC
You can find the RVM team (wayneeseguin, mpapis, envygeeks, richo, rmichael, rys, dkahoe, cwgem, ddd, lemoinem) on IRC, usually in #rvm on irc.freenode.net
If we do not respond right away, leave a message and we'll respond or leave you a memo when we are around.
Sponsors
$ rvm help # Documentation Index

JRuby

JRuby is a ruby interpreter that gives the best of the JVM -- as battle-tested in the field for many years -- together with the awesomeness that is Ruby syntax.

Prerequisites

$ rvm requirements

Installing

$ rvm install jruby

Choosing the Ruby API

Currently, as of this writing, JRuby loads the Ruby 1.8 API and runs as 1.8.7 version. As of JRuby version 1.7 the default will become 1.9.

If you need to run JRuby with the 1.9 Ruby API, you can do so in RVM using after_use hooks. You must record the JRUBY configuration

export JRUBY_OPTS="--1.9"

Be sure to add this to your jruby environment file(s).

For your console environment, I recommend detecting JRuby in an after_use hook and adding the export.

So for example, your after_use hook file might look something like this:

case "$GEM_HOME" in
  *jruby*)
    JRUBY_OPTS="--1.9" ; export JRUBY_OPTS
  ;;
esac

Choosing the Ruby API on Install

You can choose which JRuby API to use by default on install or even reinstall it with the desired option:

rvm install jruby --1.9 # OR
rvm install jruby --1.8

Community Resources

RVM Documentation Index