Upgrading Ruby on Ubuntu Dapper

November 2nd, 2007 by pyrat

dapper

Ubuntu Dapper will only install ruby as high as 1.8.4 which is not ideal sometimes. To upgrade an existing ruby installation to 1.8.6 do the following.

  sudo apt-get install build-essential
sudo apt-get install libreadline5 libreadline5-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
tar -xzf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local
make
sudo make install

Even if you had rubygems you need to install it and all your gems! Again.

   wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz
tar -xzf rubygems-1.1.1.tgz
cd rubygems-1.1.1
sudo ruby setup.rb

Now this is where you need to do a little fix. Openssl will not work out of the box and some application need it so you should just set it up now.

Note: If apt-get libssl-dev complains about a not found run: sudo apt-get update

  sudo apt-get install libopenssl-ruby
sudo apt-get install libssl-dev
 
cd ~/src/ruby-1.8.6/ext/openssl
ruby extconf.rb
make
sudo make install

And thats it!

6 Responses to “Upgrading Ruby on Ubuntu Dapper”

  1. Ger Says:

    Thanks mate, I’ve searched hard for this solution! (couldnt get openssl to work)

  2. Blaz Says:

    I used

    ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz

    and

    http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz

    for more up to date versions :)

  3. gt_sdi Says:

    Thanks for the concise article. A question….how did you know that openssl wouldn’t work out of the box? Thanks GT

  4. pyrat Says:

    Hey GT,

    I installed it and then found that openssl wasnt working!

  5. peter Says:

    thanks for this Al. funny place to find you…

  6. Christoph Says:

    Thx bro, this really helped. There were lots of tutorials out there, but none of theme solved the whole thing.

    Now i can run rails apps on my ubuntu dapper LTS distribution

    Thx a million!

Leave a Reply