Installing JRuby on Ubuntu
Today we will see how to install JRuby on Ubuntu
First of all you need to download the JRuby. Download the latest JRuby accessing the link:
I am using the version 1.3.1 (jruby-bin-1.3.1.tar.gz)
Open a terminal and go to the directory where you have downloaded file and unpack the jruby file using the following command:
$ tar zxvf jruby-bin-1.3.1.tar.gz
We need to set some environment variables. I will add the following line at end of file .bashrc in your home directory.
Now, Let’s check whether JRuby is installed properly, type the command:
$ jruby -v
You should see something like this:
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.6.0_13) [i386-java]
Alright! If you are able to see the JRuby version, your system is configured properly.
Now you can start installing some gems:
$ jruby -S gem install jruby-openssl
jruby-openssl is necessary due JRuby doesn’t support the default Ruby’s openssl.
The parameter -S tells JRuby to use the scripts which are in JRuby’s bin directory, then in a second case to use the which ones in the system PATH.
If you want to install Rails:
$ jruby -S gem install rails
That’s all about!