Installation error on MacOSX BigSur 11

318 views
Skip to first unread message

Emmanuel Netter

unread,
Dec 14, 2020, 1:27:51 PM12/14/20
to nokogiri-talk
Hello.
When trying to install nokogiri 1.8.5 (macOS 11 with ruby 2.6.3p62) with sudo gem install nokogiri -v '1.8.5' --source 'https://rubygems.org/', native extension compiling fails with a bunch of messages ending with building for macOS-arm64e but attempting to link with file built for macOS-x86_64

Has anyone seen the same problem and if so what was the fix ?

Thank you in advance for your replies.

Best regards

Below the entirety of the output from console:

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.6.0/gems/nokogiri-1.8.5/ext/nokogiri

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20201214-13748-1oewoee.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.3.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.8

with the following patches applied:

- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch

- 0002-Fix-nullptr-deref-with-XPath-logic-ops.patch

- 0003-Fix-infinite-loop-in-LZMA-decompression.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.8.tar.gz into tmp/x86_64-apple-darwin20/ports/libxml2/2.9.8... OK

Running git apply with /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK

Running git apply with /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch... OK

Running git apply with /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch... OK

Running 'configure' for libxml2 2.9.8... OK

Running 'compile' for libxml2 2.9.8... OK

Running 'install' for libxml2 2.9.8... OK

Activating libxml2 2.9.8 (from /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ports/x86_64-apple-darwin20/libxml2/2.9.8)...

************************************************************************

IMPORTANT NOTICE:


Building Nokogiri with a packaged version of libxslt-1.1.32.


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.32.tar.gz into tmp/x86_64-apple-darwin20/ports/libxslt/1.1.32... OK

Running 'configure' for libxslt 1.1.32... OK

Running 'compile' for libxslt 1.1.32... OK

Running 'install' for libxslt 1.1.32... OK

Activating libxslt 1.1.32 (from /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ports/x86_64-apple-darwin20/libxslt/1.1.32)...

checking for -llzma... yes

checking for xmlParseDoc() in libxml/parser.h... yes

checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes

checking for exsltFuncRegister() in libexslt/exslt.h... yes

checking for xmlHasFeature()... yes

checking for xmlFirstElementChild()... yes

checking for xmlRelaxNGSetParserStructuredErrors()... yes

checking for xmlRelaxNGSetParserStructuredErrors()... yes

checking for xmlRelaxNGSetValidStructuredErrors()... yes

checking for xmlSchemaSetValidStructuredErrors()... yes

checking for xmlSchemaSetParserStructuredErrors()... yes

creating Makefile


current directory: /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ext/nokogiri

make "DESTDIR=" clean


current directory: /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ext/nokogiri

make "DESTDIR="

compiling html_document.c

compiling html_element_description.c

compiling html_entity_lookup.c

compiling html_sax_parser_context.c

compiling html_sax_push_parser.c

compiling nokogiri.c

compiling xml_attr.c

compiling xml_attribute_decl.c

compiling xml_cdata.c

compiling xml_comment.c

compiling xml_document.c

compiling xml_document_fragment.c

compiling xml_dtd.c

compiling xml_element_content.c

compiling xml_element_decl.c

compiling xml_encoding_handler.c

compiling xml_entity_decl.c

compiling xml_entity_reference.c

compiling xml_io.c

compiling xml_libxml2_hacks.c

compiling xml_namespace.c

compiling xml_node.c

compiling xml_node_set.c

compiling xml_processing_instruction.c

compiling xml_reader.c

compiling xml_relax_ng.c

compiling xml_sax_parser.c

compiling xml_sax_parser_context.c

compiling xml_sax_push_parser.c

compiling xml_schema.c

compiling xml_syntax_error.c

compiling xml_text.c

compiling xml_xpath_context.c

compiling xslt_stylesheet.c

linking shared-object nokogiri/nokogiri.bundle

ld: warning: directory not found for option '-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.Internal.sdk/usr/local/lib'

ld: warning: ignoring file html_element_description.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file html_document.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file html_entity_lookup.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file html_sax_parser_context.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file nokogiri.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_attribute_decl.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_attr.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file html_sax_push_parser.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_cdata.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_comment.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ld: warning: ignoring file xml_document_fragment.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ignoring file xml_document.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_element_content.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_dtd.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_element_decl.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_entity_decl.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_encoding_handler.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_io.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_entity_reference.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_libxml2_hacks.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_node.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_namespace.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_node_set.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_processing_instruction.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_reader.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_sax_parser.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_sax_parser_context.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_sax_push_parser.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_relax_ng.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_schema.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_syntax_error.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_text.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xslt_stylesheet.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file xml_xpath_context.o, building for macOS-arm64e but attempting to link with file built for unknown-x86_64

ld: warning: ignoring file /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ports/x86_64-apple-darwin20/libxslt/1.1.32/lib/libexslt.a, building for macOS-arm64e but attempting to link with file built for macOS-x86_64

ld: warning: ignoring file /usr/local/Cellar/xz/5.2.3/lib/liblzma.dylib, building for macOS-arm64e but attempting to link with file built for macOS-x86_64

ld: warning: ignoring file /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ports/x86_64-apple-darwin20/libxml2/2.9.8/lib/libxml2.a, building for macOS-arm64e but attempting to link with file built for macOS-x86_64

ld: warning: ignoring file /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.8.5/ports/x86_64-apple-darwin20/libxslt/1.1.32/lib/libxslt.a, building for macOS-arm64e but attempting to link with file built for macOS-x86_64

ld: in '/usr/local/lib/libcharset.1.dylib', building for macOS-arm64e but attempting to link with file built for macOS-x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [nokogiri.bundle] Error 1


make failed, exit code 2


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

Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/nokogiri-1.8.5/gem_make.out


Mike Dalessio

unread,
Dec 14, 2020, 1:34:52 PM12/14/20
to nokogiri-talk
Hi! Sorry you're having trouble. It looks like you've got a "mixed installation", that is: some files have an "arm64e" architecture but your compiler is still compiling "x86-64" architecture files.

Can you tell us more about how your system arrived at its current state?

- Did you upgrade to Big Sur from a pre-existing OS version, or is this a fresh installation? (I'm inferring that you upgraded.)
- If upgrade: Did you re-install your Ruby (i.e., recompile it for the current clang version)?
- If upgrade: Did you re-install your brew-installed libraries?

Can you try to `gem install bcrypt` (which is a gem with a small, self-contained C extension) to verify that the Ruby toolchain is working correctly on your system?

Can you tell us what `ruby -v` emits? And tell us more about how you installed Ruby?



--
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 view this discussion on the web visit https://groups.google.com/d/msgid/nokogiri-talk/f4bae1d5-452d-4f6d-826d-87eccfdacdabn%40googlegroups.com.

Emmanuel Netter

unread,
Dec 14, 2020, 2:25:25 PM12/14/20
to nokogiri-talk
Mike, Thank you very much for your reply. It pointed me towards the solution of my problem, which was that big sur substituted bash for zsh, and rbenv was not loaded in my terminal session. The following commands solved the problem. 

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc 
source ~/.zshrc

Now Nokogiri compiled without problems.

For the record :

- Yes, I upgraded to Big Sur from Catalina
- No, I did not recompile ruby, I suppose it either came with the system or was installed previously in Catalina
- No, I did not reinstall the brew libraries.

Thanks again for your help!

Mike Dalessio

unread,
Dec 14, 2020, 3:30:07 PM12/14/20
to nokogiri-talk
Thanks for closing the loop here! I'm glad you were able to figure it out.

Cheers!
-mike


Reply all
Reply to author
Forward
0 new messages