It seems that the idiomatic way to provide flags to JRuby in an RVM-based Rails project is to set the environmental variable JRUBY_OPTS or PROJECT_JRUBY_OPTS, the latter per
I put export JRUBY_OPTS="..."
in my project's .rvmrc
, at the bottom of the file. This works for me.
export JRUBY_OPTS="--1.9 -J-XX:+CMSClassUnloadingEnabled -J-XX:+UseConcMarkSweepGC -J-XX:MaxPermSize=256m -J-Xmx1024m"
$ jruby -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]