運行update-alternatives --config ruby
失敗:
# 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 天前(2012 年 1 月 15 日)我寫了一個 Puppet 清單,用於update-alternatives
設定正確的 Ruby 版本。今天,更新替代方案失敗了,如上所述。 Ruby 替代品去了哪裡?
答案1
好吧,您需要安裝 1 個以上版本的 ruby,以便可能有「ruby」的替代品(通常是 /usr/bin/ruby
如果您只安裝了 ruby1.9.1 (ruby1.9.X),則沒有 alt。可用的
前任。 11.10,- 對於某些媒體應用程序,我需要同時安裝 1.9.2 和 1.8,因此更新替代方案反映了這一點並允許我根據需要進行切換
$ 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:
預設情況下,在 11.04/11.10 中,「ruby」套件提供 ruby1.8