RVM Ruby 1.9.1 安装无法找到 zlib,但它的运行时和开发库在那里
尝试在全新安装 (fedora) 上启动 Ruby 1.9.1 并使用 RVM 运行。
执行rvm install 1.9.1
后,rubygems错误日志显示无法找到zlib
没有要加载的文件 - zlib (LoadError)
但是,zlib 运行时库和开发库都已安装并且是最新的。
我现在对这个有点难住了。
Trying to get Ruby 1.9.1 up and running with RVM on a fresh install (fedora).
After doing rvm install 1.9.1
, the rubygems error logs show that zlib can't be located
no such file to load -- zlib (LoadError)
However both the zlib runtime and development libraries are installed and up-to-date.
I'm kinda stumped on this one at the moment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
使用rvm安装zlib
https://rvm.io/packages/zlib/
编辑:< code>rvm package 命令在 v1.6.25 中重命名为
rvm pkg
。Use rvm to install zlib
https://rvm.io/packages/zlib/
Edit: The
rvm package
command was renamed torvm pkg
in v1.6.25.在编译/安装 Ruby 之前,您需要安装
zlib
。如果您没有这样做,请确保从~/.rvm
文件夹中删除与 Ruby 1.9.1 相关的所有内容(以便从头开始构建)。使用您最喜欢的软件包管理器安装
zlib
:您可能还想安装以下软件包,因为 OpenSSL 等工具需要它们,
Nokogiri、IRB 或 SQLite:
然后再次安装 Ruby 1.9.1(现在我建议使用较新的版本):
注意“正在编译...”。这应该需要一段时间。如果没有,那么 Ruby 1.9.1 可能仍会被缓存
在您的
~/.rvm
文件夹中。You need to install
zlib
before compiling/installing Ruby. If you didn't do this, make sure to remove everything related to Ruby 1.9.1 from your~/.rvm
folder (so that it will be build from scratch).Install
zlib
using your favorite package manager:You might also want to install the following packages as they are required by tools like OpenSSL,
Nokogiri, IRB or SQLite:
Then install Ruby 1.9.1 again (nowadays I would suggest to use a newer version):
Watch for "compiling ...". This should take a while. If it doesn't, then Ruby 1.9.1 might still be cached
in your
~/.rvm
folder.我在尝试时遇到了这个问题:
对我(Ubunut 10.10,ruby MRI 1.8.7)实际有用的是:
所以基本上:只需遵循 rvm 手册
I encountered this problem when trying to:
What actually worked for me (Ubunut 10.10, ruby MRI 1.8.7) is:
So basically: just follow the rvm manual
在现代版本的rvm中,package参数已被替换为pkg参数。
现在,为了为 rvm 安装 zlib 软件包,需要:
rvm pkg install zlib
In modern version of rvm package argument have been replaced pkg argument.
Now, in order to install zlib package for rvm need:
rvm pkg install zlib
由于您使用的是 Fedora,请尝试运行:
然后尝试使用 RVM 安装 ruby 1.9.1
Since you are using Fedora try running:
And then try installing ruby 1.9.1 using RVM
另外,您确实知道 1.9.1 已经严重损坏,这就是为什么没有人认真使用它,对吗?这对所提出的问题的重要性在于,许多人没有意识到这一点并尝试将其与 Ruby On Rails 等 API 一起使用。然而,正如 rubyonrails.org/download 所说,Ruby 1.9.1 不支持与 Rails 一起使用,因为它已损坏。
Also, you do know that 1.9.1 is horribly broken which is why no one uses it seriously, right? The importance this has to the question asked is that many people do not realize this and attempt to use it with such APIs as Ruby On Rails. However, as rubyonrails.org/download states, Ruby 1.9.1 is not supported for use with Rails as it is broken.
在最新的 Ubuntu (11.10) 上,readline 也存在问题。
因此,我的 ubunutu 11.10 的整个 rvm 和最新 ruby 安装过程是:
我发布此信息以供将来参考,以防其他人也遇到此问题。
On the latest Ubuntu (11.10) there is also an issue with readline.
So my entire rvm and latest ruby install process for ubunutu 11.10 was:
I'm posting this for my future reference and in case anyone else bumps into this issue as well.
对我来说,解决方案非常简单:我忘记了关闭/重新打开 shell,正如 rvm 安装程序指示我做的那样。
完成此操作后,zlib 错误消失了,我能够: gem install bundler
For me, the solution was very simple: I had forgotten to close/reopen the shell, as rvm setup had instructed me to do.
After I did that, the zlib error was gone and I was able to: gem install bundler