1

我在一个非常干净的 Lucid VM 上安装了 ruby​​gems1.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 问题。

我需要 Gems > 1.8 来安装另一个包。

4

1 回答 1

-1

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

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

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

于 2013-01-18T01:00:09.317 回答