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

查看:241
本文介绍了在Ubuntu中全新安装RVM不会让我安装宝石(zlib错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



列出我的红宝石我是get:

  aaron @ aaron-VirtualBox:〜$ rvm list 

rvm rubies

=> ruby-1.9.2-p290 [x86_64]

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

  aaron @ aaron-VirtualBox:〜$ gem install rails 
错误:加载命令:install(LoadError)
没有这样的文件加载 - zlib
错误:执行gem时...(NameError)
未初始化的常量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] aaron的密码:
正在读取软件包列表...完成
构建依赖树
Rea ding状态信息...完成
注意,选择'libxslt1-dev'而不是'libxslt-dev'
注意,选择'libncurses5-dev'而不是'ncurses-dev'
autoconf已经是最新版本了。
bison已经是最新版本了。
build-essential已经是最新版本。
git-core已经是最新版本。
libc6-dev已经是最新版本。
libncurses5-dev已经是最新版本。
libreadline6已经是最新版本。
libreadline6-dev已经是最新版本。
libsqlite3-0已经是最新版本。
libsqlite3-dev已经是最新版本。
libssl-dev已经是最新版本。
libxslt1-dev已经是最新版本。
libyaml-dev已经是最新版本。
openssl已经是最新版本。
sqlite3已经是最新版本。
zlib1g已经是最新版本。
zlib1g-dev已经是最新版本。
curl已经是最新版本了。
libxml2-dev已经是最新版本。
0升级,0新安装,0删除和0未升级。
aaron @ aaron-VirtualBox:〜$ gem install rails
错误:加载命令:install(LoadError)
无此类文件加载 - zlib
错误:执行gem时。 ..(NameError)
未初始化的常量Gem :: Commands :: InstallCommand
aaron @ aaron-VirtualBox:〜$


解决方案

运行 rvm notes 并确保使用 apt-get 来安装RVM告诉你的东西。它(沿着 zlib1g-devel 的行将成为其中之一)。



对于Ubuntu,它应该是这样的:
$ b

/ 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%肯定)。


Ok, I just created a fresh Ubuntu 11.04 install on Windows 7 using VirtualBox (not sure if this matters or not but just an fyi)

listing my rubies I get:

aaron@aaron-VirtualBox:~$ rvm list

rvm rubies

=> ruby-1.9.2-p290 [ x86_64 ]

but then trying to install the rails gem I get this:

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:~$ 

What am I doing wrong?

Edit:
After doing what Dylan said my output (to prove those libraries are now installed):

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:~$

解决方案

Run rvm notes and make sure to use apt-get to install the things RVM tells you to. It (something along the lines of zlib1g-devel will be one of them).

For Ubuntu, it should be something like this:

/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

You might have to recompile your 1.9.2 afterwards (not 100% sure of that).

这篇关于在Ubuntu中全新安装RVM不会让我安装宝石(zlib错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆