Skip to content

Instantly share code, notes, and snippets.

@dnagir
Created January 13, 2012 09:43
Show Gist options
  • Save dnagir/1605310 to your computer and use it in GitHub Desktop.
Save dnagir/1605310 to your computer and use it in GitHub Desktop.
RVM JRuby 1.9 mode
> if [[ "$RUBY_VERSION" == "jruby-19" ]]; then export export PROJECT_JRUBY_OPTS=( --1.9 ); fi
> rvm use $RUBY_VERSION
> cd ~/.rvm/hooks
> chmod -x after_use_jruby
> chmod +x after_use_jruby_opts
> # Just set PROJECT_JRUBY_OPTS before running RVM, thats it
> export PROJECT_JRUBY_OPTS=( --1.9 )
> rvm use jruby
> ruby -v
> jruby 1.6.5.1 (ruby-1.9.2-p136) (2011-12-27 1bf37c2) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]
> echo $JRUBY_OPTS
--client -J-d32 --1.9
> # Note the other JRUBY_OPTS are preserved
> # Also note the when shelling out it is still Ruby 1.9
> ruby -e "system('ruby -v')"
jruby 1.6.5.1 (ruby-1.9.2-p136) (2011-12-27 1bf37c2) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment