ruby dependencies in ubuntu

Other than installing rvm and rails. ubuntu users will have to install the dependencies, “rvm requirements” will give you a list like this

/usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

After that, we need to install readline

rvm package install readline
cd $HOME/.rvm/src/ruby-1.9.x/ext/readline
ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"
make install

Updating ruby to version 1.9.1 in ubuntu 8.04

unfortunately, ubuntu 8.04 hardy comes with ruby version 1.8.6 by default. The latest rubygems doesn’t work well with this version. so we need to get a new version for ruby.

might want to check if you have these libraries first:

sudo apt-get install libncurses5-dev
sudo apt-get install libreadline5-dev

Download the ruby the latest source and compile it.

tar -xzvf ruby.19.1-p243.tar.gz
cd ruby1.9.1-p243
make install

if getting errors like so:

cd ruby.19.1-p243/ext/readline
ruby extconf.rb
sudo make install

If you have an old gem running, you can update it by

gem update --system

else you might want to visit to get the latest file... then extract and compile it just like before.