在Ubuntu中新安装的RVM不允许我安装宝石(zlib错误)。[英] Fresh install of RVM in Ubuntu isn't letting me install gems (zlib error)

本文是小编为大家收集整理的关于在Ubuntu中新安装的RVM不允许我安装宝石(zlib错误)。的处理方法,想解了在Ubuntu中新安装的RVM不允许我安装宝石(zlib错误)。的问题怎么解决?在Ubuntu中新安装的RVM不允许我安装宝石(zlib错误)。问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

好的,我刚刚使用 VirtualBox 在 Windows 7 上创建了一个全新的 Ubuntu 11.04 安装(不确定这是否重要,仅供参考)

列出我得到的红宝石:

aaron@aaron-VirtualBox:~$ rvm list

rvm rubies

=> ruby-1.9.2-p290 [ x86_64 ]

然后尝试安装 rails gem 我得到了这个:

aaron@aaron-VirtualBox:~$ gem install rails
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand
aaron@aaron-VirtualBox:~$ 

我做错了什么?

编辑:
在完成 Dylan 所说的输出之后(证明这些库现在已安装):

aaron@aaron-VirtualBox:~$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
[sudo] password for aaron: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
autoconf is already the newest version.
bison is already the newest version.
build-essential is already the newest version.
git-core is already the newest version.
libc6-dev is already the newest version.
libncurses5-dev is already the newest version.
libreadline6 is already the newest version.
libreadline6-dev is already the newest version.
libsqlite3-0 is already the newest version.
libsqlite3-dev is already the newest version.
libssl-dev is already the newest version.
libxslt1-dev is already the newest version.
libyaml-dev is already the newest version.
openssl is already the newest version.
sqlite3 is already the newest version.
zlib1g is already the newest version.
zlib1g-dev is already the newest version.
curl is already the newest version.
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
aaron@aaron-VirtualBox:~$ gem install rails
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand
aaron@aaron-VirtualBox:~$

推荐答案

运行 rvm notes 并确保使用 apt-get 来安装 RVM 告诉你的东西.它(类似于 zlib1g-devel 的东西就是其中之一).

对于 Ubuntu,应该是这样的:

/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev

之后您可能需要重新编译您的 1.9.2(不是 100% 肯定).

本文地址:https://www.itbaoku.cn/post/786470.html