2

I will be using JRuby - so am reading up on it. The http://jruby.org/ home page appears to support multiple versions of Ruby (1.8.7 and 1.92). How do I differentiate between a Rail2/Ruby1.8.7 and a Rails3/Ruby1.9.2 setup? I will be in a Windows environment and I use PIK for multiple Ruby versions, just not sure how JRuby fits in!

EDT: No - I am not asking How to make JRuby 1.6 default to Ruby 1.9. I have two environments that I have to work in and need to differentiate between a Rail2/Ruby1.8.7 and a Rails3/Ruby1.9.2. It appears that (from jruby site) that "Both versions in single install". I just don't see how that works!? I am going to try figuring this out this week.

rtfminc
  • 6,243
  • 7
  • 36
  • 45
  • if i may ask, why still using ruby 1.8.7 and rails 2? – Kokizzu Mar 16 '13 at 12:16
  • possible duplicate of [How to make JRuby 1.6 default to Ruby 1.9?](http://stackoverflow.com/questions/4755900/how-to-make-jruby-1-6-default-to-ruby-1-9) – phoet Mar 16 '13 at 12:33

1 Answers1

1

I think you are looking for the two options --1.9 and --1.8 (and upcoming --2.0)

$ jruby --1.9 -e 'h = {new: "features"} ; p h; puts RUBY_VERSION'
{:new=>"features"}
1.9.3

$ jruby --1.8 -e '"and\nold\nones".each{|l| puts l}; puts RUBY_VERSION'    
and
old
ones
1.8.7

Btw. I think they are planning to drop 1.8 support in the next JRuby major release.

reto
  • 16,189
  • 7
  • 53
  • 67