RVM Ruby 1.9.1 安装无法找到 zlib,但它的运行时和开发库在那里

发布于 2024-08-24 21:15:19 字数 237 浏览 6 评论 0原文

尝试在全新安装 (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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

淡看悲欢离合 2024-08-31 21:15:19

使用rvm安装zlib

https://rvm.io/packages/zlib/

rvm package install zlib
rvm remove 1.9.1
rvm install 1.9.1 -C --with-zlib-dir=$rvm_path/usr

编辑:< code>rvm package 命令在 v1.6.25 中重命名为 rvm pkg

Use rvm to install zlib

https://rvm.io/packages/zlib/

rvm package install zlib
rvm remove 1.9.1
rvm install 1.9.1 -C --with-zlib-dir=$rvm_path/usr

Edit: The rvm package command was renamed to rvm pkg in v1.6.25.

段念尘 2024-08-31 21:15:19

在编译/安装 Ruby 之前,您需要安装 zlib。如果您没有这样做,请确保从 ~/.rvm 文件夹中删除与 Ruby 1.9.1 相关的所有内容(以便从头开始构建)。

使用您最喜欢的软件包管理器安装 zlib

sudo apt-get install zlib1g-dev

您可能还想安装以下软件包,因为 OpenSSL 等工具需要它们,
Nokogiri、IRB 或 SQLite:

 libssl-dev libreadline6-dev libxml2-dev libsqlite3-dev

然后再次安装 Ruby 1.9.1(现在我建议使用较新的版本):

rvm install 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:

sudo apt-get install zlib1g-dev

You might also want to install the following packages as they are required by tools like OpenSSL,
Nokogiri, IRB or SQLite:

 libssl-dev libreadline6-dev libxml2-dev libsqlite3-dev

Then install Ruby 1.9.1 again (nowadays I would suggest to use a newer version):

rvm install 1.9.1

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.

梦醒时光 2024-08-31 21:15:19

我在尝试时遇到了这个问题:

gem 安装粗鲁

对我(Ubunut 10.10,ruby MRI 1.8.7)实际有用的是:

  • 阅读rvm注释并安装我的ruby版本的依赖项

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 autoconf< /p>

  1. rvm 软件包安装 zlib
  2. rvm 删除 1.8.7
  3. rvm安装1.8.7

所以基本上:只需遵循 rvm 手册

I encountered this problem when trying to:

gem install gruff

What actually worked for me (Ubunut 10.10, ruby MRI 1.8.7) is:

  • reading the rvm notes and installing the dependencies for my ruby version

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 autoconf

  1. rvm package install zlib
  2. rvm remove 1.8.7
  3. rvm install 1.8.7

So basically: just follow the rvm manual

只有影子陪我不离不弃 2024-08-31 21:15:19

在现代版本的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

孤城病女 2024-08-31 21:15:19

由于您使用的是 Fedora,请尝试运行:

yum install zlib-devel.i686

然后尝试使用 RVM 安装 ruby​​ 1.9.1

rvm install 1.9.1

Since you are using Fedora try running:

yum install zlib-devel.i686

And then try installing ruby 1.9.1 using RVM

rvm install 1.9.1
兲鉂ぱ嘚淚 2024-08-31 21:15:19

另外,您确实知道 1.9.1 已经严重损坏,这就是为什么没有人认真使用它,对吗?这对所提出的问题的重要性在于,许多人没有意识到这一点并尝试将其与 Ruby On Rails 等 API 一起使用。然而,正如 ruby​​onrails.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.

逐鹿 2024-08-31 21:15:19

在最新的 Ubuntu (11.10) 上,readline 也存在问题。

如果您需要完成或历史记录,则无法要求 Readline
安装 readline 然后重新安装 ruby​​。

因此,我的 ubunutu 11.10 的整个 rvm 和最新 ruby​​ 安装过程是:

# install rvm
sudo apt-get install curl
curl -L get.rvm.io | bash -s stable

# install dependencies
rvm pkg install zlib
rvm pkg install readline

# install additional dependencies -- follow instructions for your distribution/version
rvm requirements

# install ruby
rvm install [ruby-version]

我发布此信息以供将来参考,以防其他人也遇到此问题。

On the latest Ubuntu (11.10) there is also an issue with readline.

Readline was unable to be required, if you need completion or history
install readline then reinstall ruby.

So my entire rvm and latest ruby install process for ubunutu 11.10 was:

# install rvm
sudo apt-get install curl
curl -L get.rvm.io | bash -s stable

# install dependencies
rvm pkg install zlib
rvm pkg install readline

# install additional dependencies -- follow instructions for your distribution/version
rvm requirements

# install ruby
rvm install [ruby-version]

I'm posting this for my future reference and in case anyone else bumps into this issue as well.

梦与时光遇 2024-08-31 21:15:19

对我来说,解决方案非常简单:我忘记了关闭/重新打开 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文