Make Ruby 1.9.1 default on Ubuntu 9.10 Karmic Koala

Blog calendar

RSS feed from Michal Frackowiak's blog

subscribe to the RSS feed

— or —

get my blog posts via email

michal-frackowiakmichal-frackowiak
SquarkSquark
shark797039shark797039
Arotaritei VladArotaritei Vlad
clearekicleareki
RefutnikRefutnik
TRT- Vipul SharmaTRT- Vipul Sharma
Matt GentileMatt Gentile
HirelawyerHirelawyer
Renew SSLSRenew SSLS
Helmut_pdorfHelmut_pdorf
Sven StettnerSven Stettner
michalf23michalf23
leigerleiger
Joshua DarbyJoshua Darby
Watch: site | category | page

Blog tags


View my profile on LinekdIn

Photos

{"module":"wiki\/image\/FlickrGalleryModule","params":{"userName":"michal_frackowiak","size":"square","perPage":"6","limitPages":"1"}}

Blogroll

Piotr Gabryjeluk's blog (Gabrys on Wikidot)
Lukasz Tarka's blog (Squark on Wikidot)

Recent posts by my friends

{"module":"feed\/FeedModule","params":{"src":"http:\/\/squark.wikidot.com\/feed\/pages\/category\/blog\/;http:\/\/piotr.gabryjeluk.pl\/feed\/pages\/category\/dev\/t\/Piotr+Gabryjeluk+dev+blog","limit":"10","module_body":"[[div style=\"font-size: 87%; margin: -0.7em 0;\"]]\n%%linked_title%%\n[[\/div]]"}}

Me in other networks:

facebook, last.fm, del.icio.us, Flickr, Flaker

« Back to the Blog

16 Dec 2009 09:26

Ubuntu Karmic Koala comes with Ruby 1.9.1 — at last. But default Ruby version is still 1.8.7, which means that ruby and irb will still link to 1.8.7, and the bright and shiny 1.9.1 will be available as ruby1.9.1 and irb1.9.1.

If you want ruby and irb to link to 1.9.1 version, look at the following piece of code that change the default ruby version. Applying this to a plain and fresh Ubuntu 9.10 Karmic Koala gives you full Ruby installation:

aptitude -y update
aptitude -y install ruby1.9.1 ruby1.9.1-dev \
        rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 g++

# If you already have 1.8 installed
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 500 \
        --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
            /usr/share/man/man1/ruby.1.8.gz \
        --slave   /usr/bin/ri ri /usr/bin/ri1.8 \
        --slave   /usr/bin/irb irb /usr/bin/irb1.8 \
        --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.8

# Install ruby1.9.1
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
         --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
                                   /usr/share/man/man1/ruby1.9.1.1.gz \
        --slave   /usr/bin/ri ri /usr/bin/ri1.9.1 \
         --slave   /usr/bin/irb irb /usr/bin/irb1.9.1 \
        --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1

# choose your interpreter
# changes symlinks for /usr/bin/ruby ,
# /usr/bin/irb, /usr/bin/ri and man (1) ruby
update-alternatives --config ruby

# now try
ruby --version

I am also installing g++ and ruby1.9.1-dev packages because some of gems need those.

BTW: Gemcutter.org is now the default gem source, out of the box.

Good luck!


rating: 0, tags: ruby ruby1.9 ubuntu

rating: 0+x

del.icio.usdiggRedditYahooMyWebFurl

Add a New Comment
asdad