bundle install fails on the nokogiri gem

331 views
Skip to first unread message

Cory S

unread,
Aug 13, 2016, 8:39:15 PM8/13/16
to nokogiri-talk
Hello,

I just created a Rails project on Ubuntu 16.04 and went to 'bundle install' but it failed on nokogiri. Nokogiri is not in my Gemfile, so I suppose it is a dependency. The logs they ask me to check out on failure don't seem to exist.

I tried the instructions here, but with no luck.

Here's the message I got from 'bundle install':

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /tmp/bundler20160813-19160-1t6ecpfnokogiri-1.6.8/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20160813-19160-4jxr91.rb extconf.rb --use-system-libraries
Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
checking for libxml-2.0... no
checking for libxslt... no
checking for libexslt... no
ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
*** 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
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--with-pkg-config
--without-pkg-config
--with-override-variables
--without-override-variables
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-exslt-dir
--without-exslt-dir
--with-exslt-include
--without-exslt-include=${exslt-dir}/include
--with-exslt-lib
--without-exslt-lib=${exslt-dir}/lib
--with-libexslt-config
--without-libexslt-config

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

  /tmp/bundler20160813-19160-1t6ecpfnokogiri-1.6.8/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20160813-19160-1t6ecpfnokogiri-1.6.8/gems/nokogiri-1.6.8 for inspection.
Results logged to /tmp/bundler20160813-19160-1t6ecpfnokogiri-1.6.8/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out





Hassan Schroeder

unread,
Aug 14, 2016, 1:21:12 PM8/14/16
to nokogi...@googlegroups.com
On Sat, Aug 13, 2016 at 10:39 AM, Cory S <corys...@gmail.com> wrote:

> I just created a Rails project on Ubuntu 16.04 and went to 'bundle install'
> but it failed on nokogiri.

> checking for libxml-2.0... no

That sure looks like a show-stopper but on a fresh vagrant box with
16.04.1 (ubuntu/xenial32) I just did the following:

> sudo apt-get install ruby
> sudo apt-get install ruby-dev
> sudo apt-get install zlib1g-dev
> sudo gem install nokogiri

:: and done. So how was your system built?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Cory S

unread,
Aug 15, 2016, 10:17:34 AM8/15/16
to nokogiri-talk
This worked! Thank you! I'm on native Ubuntu, not a virtual machine.
Reply all
Reply to author
Forward
0 new messages