Installing on OS X El Capitan

268 views
Skip to first unread message

Jack Royal-Gordon

unread,
Oct 24, 2015, 1:41:53 PM10/24/15
to nokogi...@googlegroups.com
Tried to install via “gem install nokogiri”, then tried “gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries” per this StackOverflow article. Each attempt gave the same error:

ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

    /Users/jackrg/.rbenv/versions/2.1.2/bin/ruby extconf.rb --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
checking if the C compiler accepts ... *** 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=/Users/jackrg/.rbenv/versions/2.1.2/bin/ruby
--help
--clean
/Users/jackrg/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/jackrg/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:571:in `block in try_compile'
from /Users/jackrg/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:522:in `with_werror'
from /Users/jackrg/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:571:in `try_compile'
from extconf.rb:80:in `nokogiri_try_compile'
from extconf.rb:87:in `block in add_cflags'
from /Users/jackrg/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:621:in `with_cflags'
from extconf.rb:86:in `add_cflags'
from extconf.rb:337:in `<main>'

extconf failed, exit code 1

All this after installing the latest and greatest Command Line Tools.

Any thoughts on how I can make this work?

Mike Dalessio

unread,
Oct 29, 2015, 12:10:38 AM10/29/15
to nokogiri-talk
Hi, 

Thanks for asking these questions.

First, have you seen the installation tutorial here?


If you've followed the instructions there, and having a problem, then that's great feedback that we need to improve our documentation, and I'd love to dig in to reproduce and diagnose what's going on.

If you haven't followed the instructions there, can you try that and let us know how it goes?

If you're still having an issue, can you provide the contents of the `mkmf.log` file? That contains valuable debugging information about what's going on behind the scenes.

Thanks!
-mike


--
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 http://groups.google.com/group/nokogiri-talk.
For more options, visit https://groups.google.com/d/optout.

Mike Dalessio

unread,
Nov 29, 2015, 3:28:36 PM11/29/15
to nokogiri-talk
Just want to follow up here.

This morning I set up a brand new El Capitan machine, installed homebrew 0.9.5, and installed xcode commandline tools (as the tutorial at http://www.nokogiri.org/tutorials/installing_nokogiri.html suggests); and Nokogiri 1.6.6.4 installed cleanly the first time.

I'd like to ask anyone who's reporting difficult installing nokogiri on their osx machine to please provide enough information for us to reproduce what you're seeing. I'm trying, and I can't reproduce its, so help us understand why your system is behaving the way it is.

Is it an upgrade from a previous OSX? Have you upgraded homebrew? Have you recompiled ruby? Have you followed the installation guide?

Help us reproduce what you're seeing.




Reply all
Reply to author
Forward
0 new messages