两者都安装有问题吗?并使用存储库中的版本?我将使用以下命令安装ruby 1.9.2:
sudo apt-get install ruby1.9.1-full
然后更新“ alternatives”系统以使用ruby 1.9:
$ sudo update-alternatives --config ruby
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: 2
update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in manual mode.
$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
这也将设置为替代品erb
,irb
,rdoc
,ri
,testrb
,该名男子页。但是,您需要单独更新gem命令:
$ sudo update-alternatives --config gem
There are 2 choices for the alternative gem (providing /usr/bin/gem).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gem1.8 180 auto mode
1 /usr/bin/gem1.8 180 manual mode
2 /usr/bin/gem1.9.1 10 manual mode
Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in manual mode.
我知道,它被称为ruby1.9.1而不是1.9.2,这是一些上游debian包装的东西。