Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Running update-alternatives --config ruby fails:

# uname -a
Linux test06 2.6.38-8-virtual #42-Ubuntu SMP Mon Apr 11 04:06:34 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"

# apt-get install ruby1.9.1-full
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby1.9.1-full is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.

# update-alternatives --config ruby
update-alternatives: error: no alternatives for ruby.

# ls -l /etc/alternatives/ru*
ls: cannot access /etc/alternatives/ru*: No such file or directory

2 days ago (January 15th, 2012) I wrote a Puppet manifest that used update-alternatives to setup the correct Ruby version. Today, update-alternatives fails as described above. Where did the Ruby alternatives go?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Well you need more than 1 version of ruby installed for there to possibly be an alternative to "ruby" (generally /usr/bin/ruby

If you only have ruby1.9.1 installed, (ruby1.9.X), then there is no alt. available

Ex. here on 11.10, - for some media apps I need both 1.9.2 & 1.8 installed so update-alternatives reflects that & allows me to switch as needed

$ sudo update-alternatives --config ruby
[sudo] password for doug: 
There are 2 choices for the alternative ruby (providing /usr/bin/ruby).

Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/ruby1.8     50        auto mode
  1            /usr/bin/ruby1.8     50        manual mode
* 2            /usr/bin/ruby1.9.1   10        manual mode

Press enter to keep the current choice[*], or type selection number: 

By default in 11.04/11.10 the package "ruby" provides ruby1.8

share|improve this answer
    
Must have been a mistake I made, because I now have the alternatives available. Thanks for taking the time to respond. –  François Beausoleil Jan 19 '12 at 21:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.