Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEM INSTALLING NOKOGIRI SHOULD JUST WORK #1504

Closed
arielelkin opened this issue Jul 4, 2016 · 2 comments
Closed

GEM INSTALLING NOKOGIRI SHOULD JUST WORK #1504

arielelkin opened this issue Jul 4, 2016 · 2 comments

Comments

@arielelkin
Copy link

It's just not funny anymore.

https://twitter.com/_sciwoman/status/659519813564424192

https://twitter.com/rjw1/status/2741916767

https://twitter.com/krausefx/status/659611440911773696

The sane way - NOPE

$ sudo gem install nokogiri
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.8/ext/nokogiri
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160704-86627-119yyod.rb extconf.rb
Using pkg-config version 1.1.7
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.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.4.

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.4.tar.gz into tmp/x86_64-apple-darwin15/ports/libxml2/2.9.4... OK
Running 'configure' for libxml2 2.9.4... OK
Running 'compile' for libxml2 2.9.4... OK
Running 'install' for libxml2 2.9.4... OK
Activating libxml2 2.9.4 (from /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.8/ports/x86_64-apple-darwin15/libxml2/2.9.4)...
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxslt-1.1.29.

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.29.tar.gz into tmp/x86_64-apple-darwin15/ports/libxslt/1.1.29... OK
Running 'configure' for libxslt 1.1.29... OK
Running 'compile' for libxslt 1.1.29... OK
Running 'install' for libxslt 1.1.29... OK
Activating libxslt 1.1.29 (from /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.8/ports/x86_64-apple-darwin15/libxslt/1.1.29)...
checking for main() in -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 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
    --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
    --with-xml2lib
    --without-xml2lib
    --with-libxml2lib
    --without-libxml2lib

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.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.8 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.8/gem_make.out

The use-system-libraries way – NOPE

$ sudo gem install -n /usr/local/bin nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
$ bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
$ bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Using RedCloth 4.2.9
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using addressable 2.4.0
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using colorator 0.1
Using ffi 1.9.10
Using multipart-post 2.0.0
Using gemoji 2.1.0
Using net-dns 0.8.0
Using public_suffix 1.5.3
Using sass 3.4.21
Using rb-fsevent 0.9.7
Using kramdown 1.10.0
Using liquid 3.0.6
Using mercenary 0.3.5
Using rouge 1.10.1
Using safe_yaml 1.0.4
Using jekyll-feed 0.4.0
Using mini_portile2 2.0.0
Using jekyll-paginate 1.1.0
Using jekyll-sitemap 0.10.0
Using rdiscount 2.1.8
Using redcarpet 3.3.3
Using terminal-table 1.5.2
Using bundler 1.12.5
Using jekyll-textile-converter 0.1.0
Using tzinfo 1.2.2
Using coffee-script 2.4.1
Using ethon 0.8.1
Using rb-inotify 0.9.7
Using faraday 0.9.2
Using jekyll-sass-converter 1.3.0
Installing nokogiri 1.6.7.2 with native extensions

Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.7.2/gem_make.out
Using activesupport 4.2.6
Using jekyll-coffeescript 1.0.1
Using typhoeus 0.8.0
Using listen 3.0.6
Using sawyer 0.7.0
An error occurred while installing nokogiri (1.6.7.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.7.2'` succeeds before bundling.


The use-system-libraries way but put it in /usr/lib – NOPE

$ sudo gem install nokogiri -v '1.6.7' -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib
Building native extensions with: '--use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib'
This could take a while...
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/nokogiri
@SUzB
Copy link

SUzB commented Jul 8, 2016

I am facing the same issue. Does anybody have an idea how to solve it?

@sparklemotion sparklemotion locked and limited conversation to collaborators Jul 11, 2016
@flavorjones
Copy link
Member

@arielelkin I agree that Nokogiri should "just work", and in fact it generally DOES just work on Linux and Windows. OSX is the outlier, and it's because of the combinatorial explosions of configuration options, along with the fact that Apple has decided to deliver xcode (and xcode update) configurations that are hostile to developers maintaining non-trivial C extensions.

I'm not sure what outcome you're hoping to achieve with an approach like the above -- rude, disrespectful, entitled -- but watch and hopefully learn as I treat you with more respect than you've treated Nokogiri maintainers.

We believe at this point that the installation tutorial:

http://www.nokogiri.org/tutorials/installing_nokogiri.html

works for nearly all known configurations of OSX. Did you go through the tutorial and follow all the steps for OSX? If so, that would be useful information to note when opening a support request. If not, help me understand how we can better point people like you at that tutorial? In particular, the xcode bit is really required for Mac users at this point.

If the tutorial doesn't address the problem you're having, then please make sure you provide both the output from gem install and also the mkmf.log file.

I'll further note that above, you've tried to install three different versions of Nokogiri. I'll also point out that you've got permissions errors even when you sudo, which makes me think you've either got a really weirdly configured system, or else you're trolling.


I'd like to note that the Nokogiri Code of Conduct

https://github.com/sparklemotion/nokogiri/blob/master/CONTRIBUTING.md

asks everyone to be nice and reminds you that Nokogiri maintainers are volunteers, who don't get paid to work on it, and have personal lives and families. Your approach in this issue is offensive and rude, and in all honesty represents most of what I dislike about being an open source maintainer. You expect something for nothing, and heap abuse on volunteers who have spent hundreds of thankless hours working to get Nokogiri to work on OSX.

If you've surmounted your personal communication and anger-management challenges and read this far, I'll ask that if you go through the installation tutorial and it doesn't address the problem you're having, that you open a new issue and respectfully provide enough information to help a maintainer diagnose the issue on your particular system.

I'll be locking this issue both because your request violates the CoC, but also just to preserve Yet Another Disrespectful Request for posterity, and so that when I finally get fed up and ragequit open source, I'll have plenty of interesting Github Issues to point people at.

Finally -- everyone in the Ruby community who saw this issue come in and didn't do anything to police it -- you're part of the problem, too. For every open-source maintainer who quits, y'all wring your hands and are full of regret; but these are the opportunities you miss to prevent that from happening. A community that doesn't police rudeness and disrepect is not a community I'm happy to be a part of.


@SUzB - sorry you got caught in the crossfire on this, but you've also made a very unconstructive post wherein the OP claims a problem and shows three very different logs for three different versions of Nokogiri, and you say, "I am facing the same issue." No, no you're not.

Please feel free to open a new issue providing enough information for us to diagnose your issue. At the very least, info about your OS, and if you're OSX then we'll need to know more about xcode and will need to see your logs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants