How to make JRuby 1.6 default to Ruby 1.9?

前端 未结 6 1782
北海茫月
北海茫月 2020-12-02 05:26

what is the best way to make JRuby to run in 1.9 mode by default?

i.e, I want to run rake test instead of jruby --1.9 -S rake test

<
6条回答
  •  北海茫月
    2020-12-02 05:41

    Use the JRUBY_OPTS environment variable. JRUBY_OPTS holds a list of arguments that are added to any arguments specified on the command line.

    For example (on Linux):

    $ jruby -v
    jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847) (Java HotSp...
    $ export JRUBY_OPTS=--1.9
    $ jruby -v
    jruby 1.6.0.RC1 (ruby 1.9.2 trunk 136) (2011-01-10 769f847) (Java HotSpot(TM...
    $ export JRUBY_OPTS=--1.8
    $ jruby -v
    jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847) (Java HotSpo...
    

提交回复
热议问题