1. First we need to install some development tools and libraries that Ruby needs to compile. Run the following commands from your terminal:
apt-get install build-essential vim git-core curl apt-get install bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev apt-get install libcurl4-openssl-dev libopenssl-ruby apache2-prefork-dev libapr1-dev libaprutil1-dev apt-get install libx11-dev libffi-dev tcl-dev tk-devNote you may need to run these commands as root or use sudo.
2. Download the latest version of Ruby here: http://www.ruby-lang.org/en/downloads/ under the Compiling Ruby — Source code section.
3. Extract the tar.gz file e.g. ruby-1.9.3-p125.tar.gz by typing:
tar -xvf ruby-1.9.3-p125.tar.gz4. Open the README and follow the instructions on how to compile and install Ruby.
./configure make make test make installThe install process will probably take a while, but once it's done, we can test to see if ruby installed successfully by typing "ruby -v" in the terminal. You should see something like, "ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]" if ruby installed correctly. Next we can install the Bundler and Rails gems to make sure Ruby is working correctly.
gem install bundler gem install railsLastly, create a new Rails project to test to make sure everything works!