Sunday, 18 March 2007

Howto install Ruby in Ubuntu Edgy (6.10)

So you've decided to become a rubyist? Good! If you happen to use Ubuntu Edgy, then here is the steps to install ruby.

The easiest way would be just type this command in your console and get whatever ruby version as provided by the Ubuntu.

apt-get install ruby

However, I want to run the latest and greatest ruby. As of this writing, it is 1.8.6 ( Ubuntu Edgy officially provides only ruby 1.8.2).

Here we go. Let's install ruby 1.8.6.

1. Go to http://www.ruby-lang.org/en
2. Download ruby-1.8.6.tar.bz2
3. tar xjvf ruby-1.8.6.tar.bz2
4. cd ruby-1.8.6
5. apt-get build-dep ruby1.8
6. ./configure --prefix=/usr
7. make
8. sudo make install

Voila. Now you have the freshly installed ruby on your system.
9. Now type ruby -v to see your ruby version. You'll get something like
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
10. You can start coding now!


### For windows users, download ruby one-click installer. Double click and voila, you have the ruby on your system.

2 comments:

Eric Northam said...

I had previously installed 1.8.4 via deprec and ran into a problem after upgrading to 1.8.6. There was a binary left in /usr/bin/ called ruby1.8 that was for 1.8.4. Some scripts point to ruby1.8 which will cause you to get errors such as

/usr/lib/ruby/1.8/x86_64-linux/rbconfig.rb:7: ruby lib version (1.8.6) doesn't match executable version (1.8.4) (RuntimeError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
from /usr/bin/gem:9

I removed the old one and created a link via

sudo rm /usr/bin/ruby1.8
sudo ln -s /usr/bin/ruby /usr/bin/ruby1.8

I still also had to download and install rubygems over the current gems to get everything working.

vfdvgf said...

Your Best Choice! wow power leveling and wow gold wow gold