Wednesday, May 22, 2013

Experimental 2.0.0 support in JRuby 1.7.4. BitNami JRuby Stack updated.

We are happy to announce a new release of BitNami JRubyStack which now includes JRuby 1.7.4.

We have also updated other major components of the Stack, including Tomcat 7 and Java 7, Rails 3, bundler and other useful gems. As with all BitNami Stacks, you can get the latest JRuby Stack for free as a native installer or virtual appliance. The cloud images for both the Windows Azure and the Amazon cloud will be available as well.

While the primary goal of 1.7 point releases is to fill out any missing compatibility issues with Ruby 1.9.3, JRuby 1.7.4 already includes experimental Ruby 2.0 support. JRuby 1.7 defaults to 1.9 mode, but it is both Ruby 1.8 & Ruby 1.9 compatible and both versions of Ruby are bundled in a single install. JRuby 1.7.4 also allows you to start testing Ruby 2.0.0. For more details about the new features, see the JRuby Release notes.

Here is how you can use the Ruby 2.0.0 mode in your BitNami JRuby Stack installation. You can also check our  quick start guide for getting started with BitNami JRuby Stack.

1. Open the BitNami JRubyStack console.

On Linux and Mac OS X open a terminal and go to the installation directory.
Then execute:


On Windows use the entry in the Start Menu: BitNami JRubyStack —> Use BitNami JRubySTack

Once you are in the console execute:

jruby -v

The output you receive will include:

jruby 1.7.4 (1.9.3p392)

2. Ruby 2.0.0 mode just for this session

If you want to use Ruby 2.0.0 mode just for this session, but use the 1.9.3 mode as the default, just need to add the JRUBY_OPTS environment variable for this session.

On Linux and Mac OS X execute:
export JRUBY_OPTS=--2.0

On Windows:
set JRUBY_OPTS=--2.0

Now executing jruby -v will show:
jruby 1.7.4 (2.0.0) 

Notice that once you close the terminal this configuration will be lost.

3. Ruby 2.0.0 mode as default mode

If you want to set Ruby 2.0.0 mode as the default mode (so you don’t need to configure it every time) edit the environment settings for you BitNami JRubyStack by doing the following.

On Linux and Mac OS X edit the file that you can find in the scripts directory of your installation by adding the line:
export JRUBY_OPTS=--2.0

On Windows edit the setenv.bat file in the scripts directory of your installation by adding the line:
set JRUBY_OPTS=--2.0

Now if you open the BitNami JRuby Stack console (as explained above) and execute jruby -v you will see that you are working with the Ruby 2.0.0 mode.