1. Install all of the required dependencies.
$ sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
2. Go to www.ruby-lang.org/en/downloads and download the latest stable version.
3. Assuming you've saved it into downloads, extract the tar archive.
$ cd ~/Downloads
$ tar xvfs ruby.tar.gz
4. Enter the directory and start the compilation process!
$ cd ruby
$ ./configure && make # This make take some time.
5. Move your compiled ruby binaries into the /usr/local directory, where they can be run globally.
$ sudo make install
6. For ruby gems to work as non-root, you must own the /usr/local directory. This should only be done if you are the main user planning on using gems.
$ sudo chown -R $USER /usr/local