Installation problems on Mac OS X 10.11 El Capitan

1,070 views
Skip to first unread message

Pat S

unread,
Dec 30, 2015, 8:29:05 AM12/30/15
to nokogiri-talk
Hi,

I'm trying to install nokogiri to run the jekyll-sitemap gem on a Mac Book Pro running 10.11. This was an update from Yosemite to El Capitan.

I've followed the instructions at http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x and am still having problems:

ERROR:  Error installing nokogiri:

 

 ERROR
: Failed to build gem native extension.


 

    current directory
: /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7.1/ext/nokogiri

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151229-53058-puy8ks.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.0.0

checking
for iconv.h... yes

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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

 
--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:


 

 
/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.7.1/mkmf.log


 

extconf failed
, exit code 1


 

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7.1 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.7.1/gem_make.out


When I do `brew install zlib` I get:

$ brew install zlib

Warning: homebrew/dupes/zlib-1.2.8 already installed


and when I do `brew install libxml2`


$ brew install libxml2

Warning: libxml2-2.9.3 already installed

This is a bit out of my element so I'm not really sure what I'm looking for here. Any suggestions?

Thanks!
Pat

Zigii Wong

unread,
Jan 5, 2016, 7:17:45 AM1/5/16
to nokogiri-talk
I met the same problem.

在 2015年12月30日星期三 UTC+8下午9:29:05,Pat S写道:

Mike Dalessio

unread,
Jan 5, 2016, 7:18:46 AM1/5/16
to nokogiri-talk

Please try uninstalling the zlib package and reinstall it.

--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-tal...@googlegroups.com.
To post to this group, send email to nokogi...@googlegroups.com.
Visit this group at https://groups.google.com/group/nokogiri-talk.
For more options, visit https://groups.google.com/d/optout.

Pat S

unread,
Jan 24, 2016, 5:32:41 PM1/24/16
to nokogiri-talk
Sorry, but I'm still struggling with this. I ran `brew remove zlib` and then:

$ brew install zlib

==> Installing zlib from homebrew/dupes

==> Downloading http://zlib.net/zlib-1.2.8.tar.gz

Already downloaded: /Library/Caches/Homebrew/zlib-1.2.8.tar.gz

==> Patching

patching file configure

==> ./configure --prefix=/usr/local/Cellar/zlib/1.2.8

==> make install

==> Caveats

This formula is keg-only, which means it was not symlinked into /usr/local.


OS X already provides this software and installing another version in

parallel can cause all kinds of trouble.


Generally there are no consequences of this for you. If you build your

own software and it requires this formula, you'll need to add to your

build variables:


    LDFLAGS:  -L/usr/local/opt/zlib/lib

    CPPFLAGS: -I/usr/local/opt/zlib/include


==> Summary

🍺  /usr/local/Cellar/zlib/1.2.8: 9 files, 355.3K, built in 2 seconds



If I run:
sudo gem install nokogiri


I get:


Building native extensions.  This could take a while...

ERROR:  Error installing nokogiri:

ERROR: Failed to build gem native extension.


    current directory: /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7.2/ext/nokogiri

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160124-57745-1pn9m77.rb extconf.rb

  /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.7.2/mkmf.log


extconf failed, exit code 1


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7.2 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.7.2/gem_make.out



Given the message that came out of running `brew install zlib`, I tried this (I'm not sure which would work)...


sudo gem install nokogiri --without-zlib-include="/usr/local/opt/zlib/include" --without-zlib-lib="/usr/local/opt/zlib/include"


and 

sudo gem install nokogiri --with-zlib-include "/usr/local/opt/zlib/include" --with-zlib-lib "/usr/local/opt/zlib/include"


I get this type of error...


ERROR:  While executing gem ... (OptionParser::InvalidOption)

    invalid option: --with-zlib-include



Again, I'm running Mac OS X 10.11 and I have XCode and the command line tools installed. I know there are issues with installing stuff in general on 10.11, but those issues are generally beyond me at this point.

Thanks,
Pat

Pat S

unread,
Jan 28, 2016, 8:20:23 AM1/28/16
to nokogiri-talk
I know you've had problems reproducing Mac-related El Capitan problems, but I'm curious whether you have any more insights to help me out.

Thanks,
Pat

Mike Dalessio

unread,
Jan 28, 2016, 9:56:24 AM1/28/16
to nokogiri-talk
I don't have any new insights, and I'm very sorry about that.

As a maintainer, it's incredibly difficult to debug a problem that you can't reproduce. Reproduction of OSX installation problems is the #1 problem that faces the maintainers of Nokogiri today, and unfortunately we've had very little success working with Mac users to reproduce issues like this. Partly, the sheer combinatorial problem of OSX-version + xcode + xcode-installation-type + clang-version + package-manager + package-manager-version-of-library makes it nearly impossible to identify or remove the confounding variables.

TL;DR, we need your help to reproduce the issue and diagnose it.

Can you perhaps attach your mkmf.log, your gem_make.out, and also provide more information about how your machine is configured? In particular it would be good to know what version of XCode are you running, and how you installed or compiled the Ruby that you're using.

Just for context, and I'm not trying to imply anything about you or your system when I say this, but I work at a company with 900+ developers all working on Macs and nearly all of whom use Nokogiri as a dependency, and nobody internally has seen this particular installation problem. So we need to identify what's different about your system, and the above information will help us do that.




Thanks,
Pat

Pat Schloss

unread,
Jan 28, 2016, 12:21:10 PM1/28/16
to nokogi...@googlegroups.com
TL;DR, we need your help to reproduce the issue and diagnose it.

Absolutely!

Can you perhaps attach your mkmf.log, your gem_make.out, and also provide more information about how your machine is configured? In particular it would be good to know what version of XCode are you running, and how you installed or compiled the Ruby that you're using.

I’ve attached the two files.

Here’s some other information…

$ ruby --version
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

I’m pretty sure I’m using the version that came with the OS. 

I’m running Xcode: Version 7.2 (7C68)

$ xcode-select --version
xcode-select version 2343.

Does this help any?

Thanks,
Pat


gem_make.out
mkmf.log

Aditya Shukla

unread,
May 24, 2016, 6:35:12 PM5/24/16
to nokogiri-talk
**First, check if you have Xcode installed**  
**Second, if you already have Xcode in your Mac, use this command**  

    CC=gcc rvm install-version
**Example**  

    CC=gcc rvm install-1.9.3


**Reason for this error in Mac OS is that your Ruby is not able to get the C header files**  

Hope, this works on all the Macbook's.  
**Its working on El Capitan, ruby 1.9.3, rails 3.2, mysql 5.7**

Bill Fulbright

unread,
Oct 2, 2016, 9:11:00 PM10/2/16
to nokogiri-talk
So is there an update you can do after these installs?

Just do 'brew update'?


Billl F.

Cédric Chantepie

unread,
Oct 11, 2016, 9:57:33 AM10/11/16
to nokogiri-talk
Hi,

Even after having reinstalled many libraries, there is no way to install 1.6.8 on Mac OS X 10.12.
Reply all
Reply to author
Forward
0 new messages