How do I make Ruby 1.9 the default Ruby on Ubuntu?

Martin DeMello picture Martin DeMello · Dec 12, 2009 · Viewed 42.7k times · Source

Is there any way, on Ubuntu 9.04, to install Ruby 1.8 as ruby1.8 (or get rid of it altogether) and have Ruby 1.9 be the default ruby?

Answer

just_a_dude picture just_a_dude · Dec 12, 2009

I'm not really sure, but maybe this can help:

update-alternatives --config ruby

... and here's the non-interactive, scriptable, way:

update-alternatives --set ruby /usr/bin/ruby1.9.1

You may find out about available alternatives and respective /usr/bin/... paths by doing:

update-alternatives --query ruby