You have to upgrade your ruby version from 1.8.* to 1.9.*. To do that you can do it using RVM or without.
Installing Ruby 1.9.3 on Ubuntu 12.04 Precise Pangolin (without RVM)
If you want to make Ruby 1.9 the default do the following:
sudo apt-get update
Now install the packages
sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
Make 1.9.* default
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
--slave /usr/bin/ri ri /usr/bin/ri1.9.1 \
--slave /usr/bin/irb irb /usr/bin/irb1.9.1 \
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1
choose your interpreter
changes symlinks for /usr/bin/ruby , /usr/bin/gem /usr/bin/irb, /usr/bin/ri and man (1) ruby
sudo update-alternatives --config ruby
sudo update-alternatives --config gem
Install Ruby on Ubuntu 12.04 LTS (Precise Pangolin) with RVM
Step One— Install Ruby with RVM
first update your sources lits
sudo apt-get update
Once that's done, we can start installing RVM, Ruby Version Manager.
If you do not have curl on your system, you can start by installing it:
sudo apt-get install curl
To install RVM, open terminal and type in this command:
\curl -L https://get.rvm.io | bash -s stable
After it is done installing, load RVM. You may first need to exit out of your shell session and start up a new one.
In order to work, RVM has some of its own dependancies that need to be installed. To automatically install them:
You may need to enter your root password to allow the installation of these dependencies.
On occasion the zlib package may be reported as missing. The RVM page describes the issue and the solution in greater detail here.
Step Two—Install Ruby
Once you are using RVM, installing Ruby is easy.
rvm install ruby
The latest ruby is now installed. However, since we accessed it through a program that has a variety of Ruby versions, we need to tell the system to use the version we just installed by default.
rvm use ruby --default