Nokogiri: ld: symbol(s) not found for architecture i386

Created on 7 Dec 2015  ·  10Comments  ·  Source: sparklemotion/nokogiri

Hi.

Having the same issues with installing nokogiri 1.6.7. Have tried everything being told in other issues. Mac Os the latest. Have tried --with-system-libraries with or without paths - nothing worked.

My situation is:

sudo gem install nokogiri -- --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib
Building native extensions with: '--with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib'
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/ext/nokogiri
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151207-73986-1lla6k5.rb extconf.rb --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib
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... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
    - 0001-Revert-Missing-initialization-for-the-catalog-module.patch
    - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
    - 0003-Stop-parsing-on-entities-boundaries-errors.patch
    - 0004-Cleanup-conditional-section-error-handling.patch
    - 0005-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch
    - 0006-Another-variation-of-overflow-in-Conditional-section.patch
    - 0007-Fix-an-error-in-previous-Conditional-section-patch.patch
    - 0008-CVE-2015-8035-Fix-XZ-compression-support-loop.patch
    - 0009-Updated-config.guess.patch
    - 0010-Fix-parsering-short-unclosed-comment-uninitialized-access.patch

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.2.tar.gz into tmp/x86_64-apple-darwin15/ports/libxml2/2.9.2... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0003-Stop-parsing-on-entities-boundaries-errors.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0004-Cleanup-conditional-section-error-handling.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0005-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0006-Another-variation-of-overflow-in-Conditional-section.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0007-Fix-an-error-in-previous-Conditional-section-patch.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0008-CVE-2015-8035-Fix-XZ-compression-support-loop.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0009-Updated-config.guess.patch... OK
Running git apply with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/patches/libxml2/0010-Fix-parsering-short-unclosed-comment-uninitialized-access.patch... OK
Running 'configure' for libxml2 2.9.2... OK
Running 'compile' for libxml2 2.9.2... ERROR, review '/Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7/ext/nokogiri/tmp/x86_64-apple-darwin15/ports/libxml2/2.9.2/compile.log' to see what happened. Last lines are:
========================================================================
      _xmlGzfileOpenW in libxml2.a(xmlIO.o)
      _xmlGzfileOpen_real in libxml2.a(xmlIO.o)
  "_gzopen", referenced from:
      _xmlGzfileOpenW in libxml2.a(xmlIO.o)
      _xmlGzfileOpen_real in libxml2.a(xmlIO.o)
  "_gzread", referenced from:
      _xmlGzfileRead in libxml2.a(xmlIO.o)
  "_gzwrite", referenced from:
      _xmlGzfileWrite in libxml2.a(xmlIO.o)
  "_inflate", referenced from:
      _xmlNanoHTTPRead in libxml2.a(nanohttp.o)
  "_inflateEnd", referenced from:
      _xmlNanoHTTPFreeCtxt in libxml2.a(nanohttp.o)
  "_inflateInit2_", referenced from:
      _xmlNanoHTTPScanAnswer in libxml2.a(nanohttp.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [xmllint] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
========================================================================
*** 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
/Library/Ruby/Gems/2.0.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete compile task (RuntimeError)
    from /Library/Ruby/Gems/2.0.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:337:in `chdir'
    from /Library/Ruby/Gems/2.0.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:337:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:111:in `compile'
    from /Library/Ruby/Gems/2.0.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:150:in `cook'
    from extconf.rb:289:in `block (2 levels) in process_recipe'
    from extconf.rb:182:in `block in chdir_for_build'
    from extconf.rb:181:in `chdir'
    from extconf.rb:181:in `chdir_for_build'
    from extconf.rb:288:in `block in process_recipe'
    from extconf.rb:187:in `tap'
    from extconf.rb:187:in `process_recipe'
    from extconf.rb:478:in `<main>'

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

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.7/gem_make.out
VMac:beecool virvit$ uname -a
Darwin VMac.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
platforosx

Most helpful comment

I encountered same problem.
I fixed it with:

brew unlink xz
gem install nokogiri # or bundle install
brew link xz

from http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x

All 10 comments

same here.

@virvit and @bkw Have you tried building with ARCHFLAGS="-arch x86_64" ?

Yes. No result.

19 дек. 2015 г., в 1:41, Mike Dalessio [email protected] написал(а):

@virvit and @bkw Have you tried building with ARCHFLAGS="-arch x86_64" ?


Reply to this email directly or view it on GitHub.

Ok, can you help us reproduce the issue? How is your machine configured?
What version of xcode are you running?
On Dec 19, 2015 1:43 AM, "virvit" [email protected] wrote:

Yes. No result.

19 дек. 2015 г., в 1:41, Mike Dalessio [email protected]
написал(а):

@virvit and @bkw Have you tried building with ARCHFLAGS="-arch x86_64" ?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
https://github.com/sparklemotion/nokogiri/issues/1391#issuecomment-165955230
.

Can you also confirm that you've read

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

And followed the tips there?
On Dec 19, 2015 1:06 PM, "Mike Dalessio" mike.[email protected] wrote:

Ok, can you help us reproduce the issue? How is your machine configured?
What version of xcode are you running?
On Dec 19, 2015 1:43 AM, "virvit" [email protected] wrote:

Yes. No result.

19 дек. 2015 г., в 1:41, Mike Dalessio [email protected]
написал(а):

@virvit and @bkw Have you tried building with ARCHFLAGS="-arch x86_64" ?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
https://github.com/sparklemotion/nokogiri/issues/1391#issuecomment-165955230
.

We can't fix things if you don't respond and answer questions.

I can't reproduce this with the details above.

Added #1422 to see if we can collect a clean repro.

I encountered same problem.
I fixed it with:

brew unlink xz
gem install nokogiri # or bundle install
brew link xz

from http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x

I'm having the same issue but unlinking xy doesn't seem to solve the problem. Do you have any suggestions that I might try? How can I help debug this issue?

@domoritz This issue is several years old, and maintainers were never able to reproduce. Can you please open a new issue and provide all the information that the bug report template requests? Thanks!

Was this page helpful?
0 / 5 - 0 ratings