What is the best way to get JRuby to run in 2.0 mode?
Asked
Active
Viewed 9,153 times
1 Answers
44
For a specific script, you can use the --2.0
option:
jruby --2.0 -S rails s
For setting 2.0 as the default value, set JRUBY_OPTS
:
export JRUBY_OPTS=--2.0
You can also set the value in ~/.jrubyrc
:
compat.version=2.0

Sébastien Le Callonnec
- 26,254
- 8
- 67
- 80
-
2It's still work in progress, though, but you can start playing with it. – Sébastien Le Callonnec Mar 08 '13 at 11:24
-
Ruby 2.0 is compatible with 1.9.x syntax, so if JRuby is 1.9.x compatible it should by default work with 2.0. Perhaps the way JRuby uses the JVM may cause problems with 2.0. I'm just starting to look at JRuby; hopefully it will work well with Ruby 2.0. – Adrien Lamothe May 23 '13 at 03:21
-
1@AdrienLamothe any suggestions based on your experience thus far? – Damien Roche Aug 03 '13 at 03:27
-
4FYI -- JRuby 1.7.4 has "experimental support" for Ruby 2.0 - http://jruby.org/2013/05/16/jruby-1-7-4 – codecraig Aug 27 '13 at 14:25
-
@AdrienLamothe `Ruby 2.0 is compatible with 1.9.x syntax` <- you mean 1.9.x accepts `%i(a b)` ? – nurettin Apr 17 '14 at 07:19