无法运行“宝石列表”!

时间:2010-08-26 19:08:03

标签: ruby ubuntu gem zlib rvm

我跑的时候出错:

vagrant@vagrantup:~$ sudo gem list
ERROR:  Loading command: list (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::ListCommand

即使我不使用sudo,也会收到相同的错误消息。

它在Ubuntu 10.4上,我已经安装了zlib库:

vagrant@vagrantup:~$ sudo aptitude search zlib
p   gambas2-gb-compress-bzlib2                                                    - The Gambas bzlib2 component                                                             
p   gambas2-gb-compress-zlib                                                      - The Gambas zlib compression component                                                   
p   haskell-zlib-doc                                                              - Compression and decompression in the gzip and zlib formats; documentation               
p   libcompress-raw-zlib-perl                                                     - low-level interface to zlib compression library                                         
p   libcompress-zlib-perl                                                         - Transitional dummy package for Compress::Zlib                                           
i   libghc6-zlib-dev                                                              - Compression and decompression in the gzip and zlib formats                              
v   libghc6-zlib-dev-0.5.2.0-d3bd7                                                -                                                                                         
v   libghc6-zlib-doc                                                              -                                                                                         
p   libghc6-zlib-prof                                                             - Compression and decompression in the gzip and zlib formats; profiling libraries         
v   libghc6-zlib-prof-0.5.2.0-d3bd7                                               -                                                                                         
p   libio-compress-zlib-perl                                                      - Transitional dummy package for IO::Compress::Zlib                                       
p   libio-zlib-perl                                                               - IO:: style interface to gzip/zlib compressed files/handles                              
p   libjzlib-java                                                                 - reimplementation of zlib in pure Java                                                   
i   libzlib-ruby                                                                  - transitional dummy package                                                              
v   libzlib-ruby1.8                                                               -                                                                                         
p   zlib-bin                                                                      - compression library - sample programs                                                   
i   zlib1g                                                                        - compression library - runtime                                                           
p   zlib1g-dbg                                                                    - compression library - development                                                       
i   zlib1g-dev                                                                    - compression library - development                                                       
i   zlibc                                                                         - An on-fly auto-uncompressing C library

我正在使用http://www.vagrantup.com,并且在我安装了rvm后出现错误。

问题是什么?

1 个答案:

答案 0 :(得分:3)

如何安装Ruby?如果在没有zlib支持的情况下安装Ruby,那就是问题。

您可以阅读关于在Ubuntu上安装RVM的文章here。在编译Ruby之前必须同时安装zlib和zlib-dev软件包(以及来自Ubuntu的其他软件包)。您可能只需要安装这些并重新编译Ruby。