Nokogiri: Problem installing Nokogiri

Created on 27 Jul 2017  路  4Comments  路  Source: sparklemotion/nokogiri

What is the output of gem install?
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.7.2/ext/nokogiri

/usr/bin/ruby2.3 -r ./siteconf20170725-5111-trm30k.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... no
zlib is missing; necessary for building libxml2
* 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=/usr/bin/$(RUBY_BASE_NAME)2.3
--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

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.7.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/nokogiri-1.7.2 for
inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.7.2/gem_make.out

An error occurred while installing nokogiri (1.7.2), and Bundler cannot
continue.
Make sure that gem install nokogiri -v '1.7.2' succeeds before bundling.

In Gemfile:
msfrpc-client was resolved to 1.1.0, which depends on
rex was resolved to 2.0.11, which depends on
nokogiri


And when i try ( gem install nokogiri -v '1.7.2' ) or ( gem install nokogiri ) i get the same error ^^
so the problem is with nokogiri

What are the contents of the mkmf.log file?

What operating system are you using?
Kali 2016.2

What's the output from nokogiri -v?
1.6.8.1
Can you provide a self-contained script that reproduces what you're seeing?
gem install nokogiri

metuser-help

Most helpful comment

Indeed, that was the case. Thank you very much

codes i used to install zlib and other dependencies

sudo apt-get install libpng-dev
sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev

All 4 comments

The error message you received says,

zlib is missing; necessary for building libxml2

Have you installed zlib?

Indeed, that was the case. Thank you very much

codes i used to install zlib and other dependencies

sudo apt-get install libpng-dev
sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev

think u

I'll note for future visitors to this incident: the installation tutorial covers this and many other common setup problems.

Was this page helpful?
0 / 5 - 0 ratings