Wednesday, August 18, 2010

Installing Ruby 1.9 from Source on Ubuntu in Five Minutes

This is on a clean Ubuntu Lucid Lynx image.
  • sudo apt-get install gcc libzlib-ruby libssl-dev libxslt-dev libxml2-dev libmemcached-dev libsasl2-dev libmemcached-dbg  libpq-dev libcurl4-gnutls-dev libyaml-dev make
  • wget LINK_TO_RUBY_TAR
  • tar -zxvf rubyXXXX.tar.gz
  • cd rubyXXXX
  • ./configure
  • make
  • sudo make install
That's it, try running "ruby -v" to see the ruby version.

I recommend doing the following to enable SSL support (only takes a few seconds):
  • cd ext/openssl
  • ruby extconf.rb
  • make
  • sudo make install
And lastly, update the gem system:


  • sudo gem update --system