已安装rubygems1.9.1但报告版本为1.3.5

时间:2013-01-18 00:31:21

标签: ruby rubygems version ubuntu-10.04

我在一个非常干净的Lucid VM上安装了rubygems1.9.1。

$ sudo apt-get install rubygems1.9.1
...
The following extra packages will be installed:
  irb1.9.1 libreadline-ruby1.9.1 libreadline5 rdoc1.9.1
Suggested packages:
  graphviz build-essential rubygems-doc
The following NEW packages will be installed:
  irb1.9.1 libreadline-ruby1.9.1 libreadline5 rdoc1.9.1 rubygems1.9.1
0 upgraded, 5 newly installed, 0 to remove and 85 not upgraded.
...
Get:1 http://archive.ubuntu.com/ubuntu/ lucid/main libreadline5 5.2-7build1 [147kB]
Get:2 http://archive.ubuntu.com/ubuntu/ lucid/universe libreadline-ruby1.9.1 1.9.1.378-1 [15.2kB]
Get:3 http://archive.ubuntu.com/ubuntu/ lucid/universe irb1.9.1 1.9.1.378-1 [66.9kB]
Get:4 http://archive.ubuntu.com/ubuntu/ lucid/universe rdoc1.9.1 1.9.1.378-1 [125kB]
Get:5 http://archive.ubuntu.com/ubuntu/ lucid/universe rubygems1.9.1 1.3.5-1ubuntu2 [191kB]
Fetched 545kB in 7s (76.2kB/s)                                                                                                                             
Selecting previously deselected package libreadline5.
(Reading database ... 29331 files and directories currently installed.)
Unpacking libreadline5 (from .../libreadline5_5.2-7build1_amd64.deb) ...
Selecting previously deselected package libreadline-ruby1.9.1.
Unpacking libreadline-ruby1.9.1 (from .../libreadline-ruby1.9.1_1.9.1.378-1_amd64.deb) ...
Selecting previously deselected package irb1.9.1.
Unpacking irb1.9.1 (from .../irb1.9.1_1.9.1.378-1_all.deb) ...
Selecting previously deselected package rdoc1.9.1.
Unpacking rdoc1.9.1 (from .../rdoc1.9.1_1.9.1.378-1_all.deb) ...
Selecting previously deselected package rubygems1.9.1.
Unpacking rubygems1.9.1 (from .../rubygems1.9.1_1.3.5-1ubuntu2_all.deb) ...
Processing triggers for man-db ...
Setting up libreadline5 (5.2-7build1) ...

Setting up libreadline-ruby1.9.1 (1.9.1.378-1) ...
Setting up irb1.9.1 (1.9.1.378-1) ...

Setting up rdoc1.9.1 (1.9.1.378-1) ...
Setting up rubygems1.9.1 (1.3.5-1ubuntu2) ...

然而,奇怪的是:

$ gem1.9.1 --version
1.3.5

$ cat /usr/bin/gem1.9.1 
#!/usr/bin/ruby1.9.1
...

我不确定这是打包问题还是Ruby问题(我对Ruby很新)。

有什么想法吗?我需要宝石> 1.8安装另一个包。很高兴吹走机器并在需要时重新开始。

1 个答案:

答案 0 :(得分:-1)

gem update --system是确保您使用Rubygems最高版本的良好起点。如果您的版本不支持它,那么您需要引导它,因为该功能并不总是可用。

就个人而言,我从不使用repos进行Ruby / Python / Perl安装,而是确保我拥有所需的依赖项,然后从源代码编译。

考虑安装rbenvRVM并让它管理您的Ruby安装。 RVM具有更多功能,更具侵入性。 rbenv更简单,功能更少 - 我个人使用rbenv。