I try to bundle install --gemfile=Gemfile
, but error occurs as:
An error occurred while installing nokogiri (1.7.2), and Bundler cannot continue. Make sure that
gem install nokogiri -v '1.7.2' --source 'http://rubygems.org/'
succeeds before bundling.
So I try install nokogiri, then refused:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
It seems nokogiri was locked. I wonder how to install specific version(1.7.2) of nokogiri.
My OS is Amazon Linux AMI release 2017.09, and I have installed
mysql-devel sqlite-devel libcurl-devel ruby24 ruby24-devel zlib-devel gcc libxslt-devel libxml2-devel gcc-c++ make curl
Ruby version is 2.4 and bundler at version 1.17.3. Detailed error info is:
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.