nokogiri宝石安装错误 [英] nokogiri gem installation error

查看:90
本文介绍了nokogiri宝石安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道关于这个gem有很多问题,但没有答案适用于我。



当我在SSH中运行 gem install

 将libxml2-2.8.0.tar.gz解压缩到tmp / x86_64-unknown-linux-gnu / ports / libxml2 / 2.8.0 ... OK 
运行修补程序/home/user58952277/.gem/ruby/1.9.3/gems/nokogiri-1.6.2.1/ports/ patch / libxml2 / 0001-Fix-parser-local-buffers-size-problems.patch ...
为libxml2运行'patch'2.8.0 ...错误,请查看'tmp / x86_64-unknown-linux- gnu / ports / libxml2 / 2.8.0 / patch.log'来查看发生了什么。
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

我的主机告诉我所有的库都已安装。
这是执行安装nokogiri命令后的完整日志:

 构建原生扩展。这可能需要一段时间... 
使用打包的库构建nokogiri。
为nokogiri构建libxml2-2.8.0,并应用以下修补程序:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local -buffers-size-problems.patch
- 0003-Fix-an-error-in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excessive-entities-expanding-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF-state -handling-through-the-pa.patch
- 0008-xmlStopParser.patch的改进处理
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
- 0011-Do-not-fetch-external-parameter-entities.patch
**** ************************************************** ******************
重要! Nokogiri构建并使用libxml2的打包版本。

如果这是您的担忧,并且您想要使用系统库
,请取消此安装过程并重新安装nokogiri,如
所示:

gem install nokogiri - --use-system-libraries

如果您使用的是Bundler,请告诉它使用以下选项:

bundle config build.nokogiri --use -system-libraries
bundle install

但是请注意,nokogiri不一定支持libxml2的所有版本


例如,由于兼容性问题和
XPath优化错误,libxml2-2.9.0及更高版本目前已知被破解
,因此nokogiri不支持。
********************************************** **************************
错误:安装nokogiri时出错:
错误:无法构建gem原生扩展。

/opt/rubies/ruby-1.9.3/bin/ruby extconf.rb
使用打包库构建nokogiri。
检查iconv.h ...是
在iconv.h中检查iconv_open()...是
为nokogiri构建libxml2-2.8.0并应用以下修补程序:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
- 0003-Fix-an-error -in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excess-entities-expanding-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF - 通过这个pa.patch进行状态处理
- 0008-Improve-handling -of-xmlStopParser.patch
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser .patch
- 0011-Do-not-fetch-external-parameter-entities.patch
************************ ****************************************
重要! Nokogiri构建并使用libxml2的打包版本。

如果这是您的担忧,并且您想要使用系统库
,请取消此安装过程并重新安装nokogiri,如
所示:

gem install nokogiri - --use-system-libraries

如果您使用的是Bundler,请告诉它使用以下选项:

bundle config build.nokogiri --use -system-libraries
bundle install

但是请注意,nokogiri不一定支持libxml2的所有版本


例如,由于兼容性问题和
XPath优化错误,libxml2-2.9.0及更高版本目前已知被破解
,因此nokogiri不支持。
********************************************** **************************
将libxml2-2.8.0.tar.gz解压到tmp / x86_64-unknown-linux-gnu /ports/libxml2/2.8.0 ...确定
正在运行修补程序/home/user58952277/.gem/ruby/1.9.3/gems/nokogiri-1.6.2.1/ports/patches/libxml2/0001-Fix -parser-local-buffers-size-problems.patch ...
为libxml2运行'patch'2.8.0 ...错误,请查看'tmp / x86_64-unknown-linux-gnu / ports / libxml2 / 2.8 .0 / patch.log'来查看发生了什么。
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--with-opt-dir
--without-opt-dir
--with-opt-include
- -without-opt-include = $ {opt-dir} / include
--with-opt-lib
--without-opt-lib = $ {opt-dir} / lib
--with-make-prog
--without-make-prog
--srcdir =。
--curdir
--ruby = / opt / rubies / ruby​​-1.9.3 / bin / ruby​​
- 帮助
- 清除
--use -system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
- with-zlib-include
--without-zlib-include = $ {zlib-dir} / include
--with-zlib-lib
--without-zlib-lib = $ { zlib-dir} / lib
- 启用交叉编译
- 禁用交叉编译
/home/user58952277/.gem/ruby/1.9.3/gems/mini_portile- 0.6.0 / lib / mini_portile.rb:279:在`block in execute'中:无法完成修补程序任务(RuntimeError)
from /home/user58952277/.gem/ruby/1.9.3/gems/mini_portile- 0.6.0 / lib / mini_portile.rb:271:在`chdir'中
来自/home/user58952277/.gem/ruby/1.9.3/gems/mini_portile-0.6.0/lib/mini_portile.rb:271 :在`execute'中
从extconf.rb:282:在`block in patch'
从extconf.rb:279:在`each'
从extconf.rb:279:在`从/home/user58952277/.gem/ru修补'
通过/ 1.9.3 / gems / mini_portile-0.6.0 / lib / mini_portile.rb:108:在`cook'
从extconf.rb:253:在`block in process_recipe'
from extconf。 rb:154:'tap'
from extconf.rb:154:'process_recipe'
from extconf.rb:419:in< main>'
解决方案

最后,这个问题是由nokogiri本身通过发布它自己的与某些系统不兼容的libxml2导致的。

因此,要安装nokogiri,我必须告诉它它应该使用系统库。



我手动安装它:

  gem install nokogiri -v 1.6.2.1  -  --use-system-libraries 

它运作良好。其他答案没有解决它。


I know there are a lot of questions about this gem but no answer has worked for me.

When I run in SSH gem install nokogiri I get this error:

Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.8.0... OK
Running patch with /home/user58952277/.gem/ruby/1.9.3/gems/nokogiri-1.6.2.1/ports/patches/libxml2/0001-Fix-parser-local-buffers-size-problems.patch...
Running 'patch' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.8.0/patch.log' to see what happened.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

My host told me that all libs are installed. Here are the full logs after executing the install nokogiri command:

Building native extensions.  This could take a while...
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following patches applied:
    - 0001-Fix-parser-local-buffers-size-problems.patch
    - 0002-Fix-entities-local-buffers-size-problems.patch
    - 0003-Fix-an-error-in-previous-commit.patch
    - 0004-Fix-potential-out-of-bound-access.patch
    - 0005-Detect-excessive-entities-expansion-upon-replacement.patch
    - 0006-Do-not-fetch-external-parsed-entities.patch
    - 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
    - 0008-Improve-handling-of-xmlStopParser.patch
    - 0009-Fix-a-couple-of-return-without-value.patch
    - 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
    - 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT!  Nokogiri builds and uses a packaged version of libxml2.

If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:

    gem install nokogiri -- --use-system-libraries

If you are using Bundler, tell it to use the option:

    bundle config build.nokogiri --use-system-libraries
    bundle install

However, note that nokogiri does not necessarily support all versions
of libxml2.

For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

        /opt/rubies/ruby-1.9.3/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
checking for iconv.h... yes
checking for iconv_open() in iconv.h... yes
Building libxml2-2.8.0 for nokogiri with the following patches applied:
    - 0001-Fix-parser-local-buffers-size-problems.patch
    - 0002-Fix-entities-local-buffers-size-problems.patch
    - 0003-Fix-an-error-in-previous-commit.patch
    - 0004-Fix-potential-out-of-bound-access.patch
    - 0005-Detect-excessive-entities-expansion-upon-replacement.patch
    - 0006-Do-not-fetch-external-parsed-entities.patch
    - 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
    - 0008-Improve-handling-of-xmlStopParser.patch
    - 0009-Fix-a-couple-of-return-without-value.patch
    - 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
    - 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT!  Nokogiri builds and uses a packaged version of libxml2.

If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:

    gem install nokogiri -- --use-system-libraries

If you are using Bundler, tell it to use the option:

    bundle config build.nokogiri --use-system-libraries
    bundle install

However, note that nokogiri does not necessarily support all versions
of libxml2.

For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.8.0... OK
Running patch with /home/user58952277/.gem/ruby/1.9.3/gems/nokogiri-1.6.2.1/ports/patches/libxml2/0001-Fix-parser-local-buffers-size-problems.patch...
Running 'patch' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.8.0/patch.log' to see what happened.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/opt/rubies/ruby-1.9.3/bin/ruby
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build
/home/user58952277/.gem/ruby/1.9.3/gems/mini_portile-0.6.0/lib/mini_portile.rb:279:in `block in execute': Failed to complete patch task (RuntimeError)
    from /home/user58952277/.gem/ruby/1.9.3/gems/mini_portile-0.6.0/lib/mini_portile.rb:271:in `chdir'
    from /home/user58952277/.gem/ruby/1.9.3/gems/mini_portile-0.6.0/lib/mini_portile.rb:271:in `execute'
    from extconf.rb:282:in `block in patch'
    from extconf.rb:279:in `each'
    from extconf.rb:279:in `patch'
    from /home/user58952277/.gem/ruby/1.9.3/gems/mini_portile-0.6.0/lib/mini_portile.rb:108:in `cook'
    from extconf.rb:253:in `block in process_recipe'
    from extconf.rb:154:in `tap'
    from extconf.rb:154:in `process_recipe'
    from extconf.rb:419:in `<main>'

解决方案

Finally, the problem was caused by nokogiri itself by shipping it's own libxml2 that's incompatible with some systems.
So to install nokogiri I had to tell it that it should use the system libraries.

I installed it manually by:

gem install nokogiri -v 1.6.2.1 -- --use-system-libraries

And it worked well. Other answers didn't solve it.

这篇关于nokogiri宝石安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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