Be sure that you have installed java and download Lastest version of jruby from jruby.org website by using curl command.
curl -O http://jruby.org.s3.amazonaws.com/downloads/1.7.0.RC2/jruby-bin-1.7.0.RC2.tar.gz
Create a hidden directory under your home directory and unpack the file.
cd mkdir .opt mv /Downloads/jruby-bin-1.7.0.RC2.tar.gz cd .opt tar xvfz jruby-bin-1.7.0.RC2.tar.gz ln -s jruby-1.7.0.RC2 jruby
Edit your .bash_profile file and add the following
export PATH=$PATH:/Users/kg/.opt/jruby/bin
Open a new terminal window