rtfminc
rtfminc

Reputation: 6363

Does JRuby have many versions of Ruby?

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.

Upvotes: 2

Views: 93

Answers (1)

reto
reto

Reputation: 16732

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.

Upvotes: 1

Related Questions