I am trying to upgrade Nokogiri from 1.6.7 to at least 1.8.1 (Needed by the savon 2.12.1 gem) but the installation is erroring out with a message that implies that libxslt is not found. However I thought libxslt was packaged with Nokogiri itself. I am not using system libraries.
I have tried Nokogiri version 1.8.1 and 1.9.1. I cannot move to 1.10 since Ruby 2.2. is not supported for 1.10 and above.
Any help in resolving this will be greatly appreciated. Details of the system and errors are below. Let me know if any more details are needed.
The output of bundle install is pasted below. The mkmf.log is attached.
Fetching mini_portile2 2.4.0 (was 2.0.0)
Installing mini_portile2 2.4.0 (was 2.0.0)
Fetching nokogiri 1.9.1 (was 1.6.7)
Installing nokogiri 1.9.1 (was 1.6.7) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/srirang/.rubies/ruby-2.2.10/bin/ruby -r ./siteconf20200922-26812-iq55mq.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv using --with-opt-* flags... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.8
with the following patches applied:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
- 0002-Fix-nullptr-deref-with-XPath-logic-ops.patch
- 0003-Fix-infinite-loop-in-LZMA-decompression.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.
************************************************************************
Extracting libxml2-2.9.8.tar.gz into tmp/x86_64-apple-darwin19.5.0/ports/libxml2/
2.9.8... OK
Running git apply with /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/gems/nokogiri-1.9.1/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running git apply with /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/gems/nokogiri-1.9.1/patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch... OK
Running git apply with /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/gems/nokogiri-1.9.1/patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch... OK
Running 'configure' for libxml2 2.9.8... OK
Running 'compile' for libxml2 2.9.8... OK
Running 'install' for libxml2 2.9.8... OK
Activating libxml2 2.9.8 (from /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/gems/nokogiri-1.9.1/ports/x86_64-apple-darwin19.5.0/libxml2/2.9.8)...
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxslt-1.1.32.
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
************************************************************************
Extracting libxslt-1.1.32.tar.gz into tmp/x86_64-apple-darwin19.5.0/ports/libxslt/
1.1.32... OK
Running 'configure' for libxslt 1.1.32... OK
Running 'compile' for libxslt 1.1.32... OK
Running 'install' for libxslt 1.1.32... OK
Activating libxslt 1.1.32 (from /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/gems/nokogiri-1.9.1/ports/x86_64-apple-darwin19.5.0/libxslt/1.1.32)...
checking for main() in -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... no
checking for xsltParseStylesheetDoc() in -lxslt... no
checking for xsltParseStylesheetDoc() in -llibxslt... no
-----
libxslt is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** 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
--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=/Users/srirang/.rubies/ruby-2.2.10/bin/$(RUBY_BASE_NAME)
--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
--with-xsltlib
--without-xsltlib
--with-libxsltlib
--without-libxsltlib
extconf failed, exit code 1
Gem files will remain installed in /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/gems/nokogiri-1.9.1 for inspection.
Results logged to /Users/srirang/.bundles/pw_ruby2.1.2/ruby/2.2.0/extensions/x86_64-darwin-19/2.2.0-static/nokogiri-1.9.1/gem_make.out
An error occurred while installing nokogiri (1.9.1), and Bundler cannot continue.
In Gemfile:
savon was resolved to 2.12.1, which depends on
akami was resolved to 1.3.1, which depends on
nokogiri