Blog calendar
— or —
michal-frackowiakSquark
shark797039
Arotaritei Vlad
cleareki
Refutnik
TRT- Vipul Sharma
Matt Gentile
Hirelawyer
Renew SSLS
Helmut_pdorf
Sven Stettner
michalf23
leiger
srivercx
Joshua Darby
lil g easy
Mr Shaggy
Chen XX
Super Dr Green
... and more
Blog tags
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
This worked perfectly. Thanks. It's too bad the 1.9.1 package doesn't register itself as an alternative automatically.
Thanks, this was very helpful.
Don't forget to run update-alternatives on gem, too, so you're using gem1.9.1:
Thanks for this one Neil. I had already managed to upgrade to ruby 1.9.1, but had forgotten about this. So none of my require 'the-gem-i-need' statements were working … until now :)
This worked perfectly with Lucid Lynx as well.
This also works on Ubuntu 10.4.
Thanks for posting :-)
Thank You very much.
Thanks for sharing this great post:)
Thank you! This worked perfectly.
Thanks alot dude, learned something new again.
Many, many thanks.
Thanks so much. Smooth as butter.
Thanks, this also works on lucid and it's the correct way of doing this.
No manual symlink hacks like I was about to do.. :-)