nokogiri 没有为 ruby​​-1.9.1 正确安装 [英] nokogiri not installing correctly for ruby-1.9.1

查看:30
本文介绍了nokogiri 没有为 ruby​​-1.9.1 正确安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了大家好,

我最近使用 rvm 安装了 ruby​​-1.9.1.我试过安装nokogiri 遵循本指南:

I have recently installed ruby-1.9.1 using rvm. I have tried installing nokogiri following this guide:

https://github.com/tenderlove/nokogiri/wiki/what-to-do-if-libxml2-is-being-a-jerk

但是安装 gem 后我仍然收到以下错误:

but I am still getting the following error once the gem is installed:

嗨.您使用的 libxml2 版本 2.6.16 已超过 4 年,并且具有很多错误.我们建议,为了获得最大的 HTML/XML 解析乐趣,您升级您的 libxml2 版本并重新安装 nokogiri.如果你喜欢使用libxml2 version 2.6.16,但是不喜欢这个警告,请定义常量I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 在重新请求 nokogiri 之前.

HI. You're using libxml2 version 2.6.16 which is over 4 years old and has plenty of bugs. We suggest that for maximum HTML/XML parsing pleasure, you upgrade your version of libxml2 and re-install nokogiri. If you like using libxml2 version 2.6.16, but don't like this warning, please define the constant I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring nokogiri.

我还确保在我的 Leopard 操作系统中安装的 libxml2 大于 2.6:

I have also ensured that libxml2 I have installed in my leopard operating system is greater than 2.6:

$fink list libxml2
Information about 11516 packages read in 2 seconds.
 i   libxml2          2.7.8-102    XML parsing library, version 2
 i   libxml2-bin      2.7.8-102    XML parsing library, version 2
(i)  libxml2-py25     2.7.8-1      Python bindings for libxml2 library
     libxml2-py26     2.7.8-1      Python bindings for libxml2 library
     libxml2-py27     2.7.8-1      Python bindings for libxml2 library
     libxml2-rb18     0.5.4-1      Ruby bindings for libxml2
 i   libxml2-shlibs   2.7.8-102    XML parsing library, version 2

推荐答案

因此,要么 nokogiri 没有得到完全重建,要么是针对仍然存在于您系统上的另一个版本进行重建.最简单的就是尝试gem uninstall nokogiri &&宝石清洁 &&gem install nokogiri.如果您有多个版本,请务必卸载每个版本.

So, either nokogiri isn't getting fully rebuilt, or it is but it's getting rebuilt against another version that's still living on your system. The easiest thing is to try is gem uninstall nokogiri && gem clean && gem install nokogiri. Be sure to uninstall every version if you have more than one.

接下来是尝试确保 gem 实际上是针对 fink 列出的 libxml 版本构建的.尝试删除其他版本(可能由 MacPorts 或 Homebrew 安装?)并重建 gem.

The next thing is to try to ensure that the gem is actually being built against the version of libxml listed by fink. Try removing other versions (perhaps installed by MacPorts or Homebrew?) and rebuilding the gem.

如果这没有帮助,我们需要尝试对动态链接器路径进行故障排除.我不太清楚如何在 OS X 上做到这一点,所以让我们先看看上述解决方案是否有帮助.

If that doesn't help, we'll need to try troubleshooting the dynamic linker paths. I'm not so up on how to do that on OS X, so let's see if any of the above solutions help first.

这篇关于nokogiri 没有为 ruby​​-1.9.1 正确安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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