Jruby on Ubuntu 10.04

Installation of Jruby on ubuntu

1. First of all get the installer  for the Jruby from the jruby site http://jruby.org/download. As we wanted to use the latest version 1.6.2 so we downloaded that version and as we want to do this installation on Ubuntu so we  downloaded  .tar.gz  file (JRuby 1.6.2 Binary .tar.gz (md5, sha1)

2. After downloading  we need to install it by copying it to a location where it is easily accessible.We have extracted file (jruby-1.6.2) kept it  at HOME directory

3. Now to make it available, we need to add the path to the environment variable, for that we need to open the  .bashrc file.

4. To open the .bashrc file you can use the command on the terminal as ($  gedit ~/.bashrc)

5. It will open the file in editor then add the below mentioned code as per your directory path.You have to add two line of code which will define the  path of the jruby and other will add that to Environment variable $PATH

export JRUBY_HOME=/home/jruby-1.6.2

export PATH=$JRUBY_HOME/bin:$PATH

6. Once it is done then try the command on terminal  to ensure that Jruby is installed

$Jruby  -v

If any issues then try using RVM

1.  We have faced a lot of issues to run the application on the Ubuntu and finally, we need to install the RVM to make it work, so here are the steps which we have followed.

2.  First of all install the git and curl so that we can use the commands to install the rvm

COMMANDS —

sudo apt-get update  # this will do the housekeeping work for you

sudo apt-get install build-essential git-core curl  # this will install the curl & sgit

3.  Now to get the rvm installed run command

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

Or

use system wide installer

# bash < <( curl -L http://bit.ly/rvm-install-system-wide )

Once this command is completed then open the .bashrc file to make some changes related to RVM

export rvm_path=/usr/local/rvm

[[ -s “$rvm_path/scripts/rvm” ]] && source “$rvm_path/scripts/rvm”

Advertisements

5 thoughts on “Jruby on Ubuntu 10.04

Add yours

  1. Hi,
    Thanks for the post. I just have one question. I have followed your instructions but when i run Jruby -v, I get this error:

    No command ‘Jruby’ found, did you mean:
    Command ‘jruby’ from package ‘jruby1.1’ (universe)
    Command ‘jruby’ from package ‘jruby’ (multiverse)
    Command ‘eruby’ from package ‘eruby’ (universe)
    Command ‘ruby’ from package ‘ruby’ (main)
    Jruby: command not found

    Do you know what I’m missing? I have Ubuntu 10.04 and Jruby 1.7.4

  2. Hi,
    Are you using rvm?
    If you have used rvm then i hope you have set it default to jruby.

    e.g rvm use jruby-1.7.4
    after that on terminal if try
    $ jruby -v
    this will show all the details

    If you are not using jruby and still it does not show up then the only reason could be that “.bashrc” is not reloaded.
    You can do it two ways
    1. Close the terminal and reopen then try “jruby -v”
    2. type command on terminal as ” . ~/.bashrc” that will reload the bash

    I hope this will help.

    Thanks
    Shivani

    1. Hi,

      Thanks for the prompt response!

      I’m not using rvm, but when I reloaded the bash and then tried $jruby -v I got this error:

      /home/jruby-1.7.4/bin/jruby: line 395: exec; java: not found

      Should I install a different version of Jruby or should I do something else?

      Thanks in advance!

      1. Hi,

        Me again, I checked the file and line 395-400 has these contents:
        else
        exec “$JAVACMD” $JAVA_OPTS “$JFFI_OPTS” “${java_args[@]}” -Xbootclasspath/a:”$JRUBY_CP” -classpath “$CP$CP_DELIMITER$CLASSPATH” \
        “-Djruby.home=$JRUBY_HOME” \
        “-Djruby.lib=$JRUBY_HOME/lib” -Djruby.script=jruby \
        “-Djruby.shell=$JRUBY_SHELL” \
        $java_class $mode “$@”
        fi

  3. As jruby requires Java I think your error shows that java is missing. You should install java. and set all environment variables for Java and when you check on terminal “javac” and “java” version it should show you what version of java is installed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: