无法安装nokogiri

时间:2019-03-05 12:09:15

标签: ruby rubygems nokogiri bundler amazon-linux

我尝试bundle install --gemfile=Gemfile,但错误发生为:

  

在安装nokogiri(1.7.2)和Bundler时发生错误   无法继续。捆绑之前,请确保gem install nokogiri -v '1.7.2' --source 'http://rubygems.org/'成功。

所以我尝试安装nokogiri,然后拒绝了:

  

错误:安装nokogiri时出错:
            错误:无法构建gem本机扩展。

似乎nokogiri已被锁定。我不知道如何安装nokogiri的特定版本(1.7.2)。

我的操作系统是Amazon Linux AMI版本2017.09,并且我已经安装了

  

mysql-devel sqlite-devel libcurl-devel ruby​​24 ruby​​24-devel zlib-devel   gcc libxslt-devel libxml2-devel gcc-c ++使卷曲

Ruby版本为2.4,捆绑程序版本为1.17.3。详细的错误信息是:

current directory: /usr/local/share/ruby/gems/2.4/gems/nokogiri-1.7.2/ext/nokogiri
/usr/bin/ruby2.4 -r ./siteconf20190305-30890-gjsryi.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.4
with the following patches applied:
    - 0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch
    - 0002-Fix-XPointer-paths-beginning-with-range-to.patch
    - 0003-Disallow-namespace-nodes-in-XPointer-ranges.patch

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows: 
gem install nokogiri -- --use-system-libraries
        [--with-xml2-config=/path/to/xml2-config]
        [--with-xslt-config=/path/to/xslt-config]

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

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

Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.

0 个答案:

没有答案