Have you read and followed the installation tutorial at http://www.nokogiri.org/tutorials/installing_nokogiri.html?
What is the complete output of gem install or bundle install?
$ gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/ext/nokogiri
/opt/homebrew/opt/ruby/bin/ruby -I /opt/homebrew/Cellar/ruby/3.0.0/lib/ruby/3.0.0 -r ./siteconf20201227-85216-mtam8o.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... 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.4.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv using --with-opt-* flags... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.10
with the following patches applied:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
- 0002-Remove-script-macro-support.patch
- 0003-Update-entities-to-remove-handling-of-ssi.patch
- 0004-libxml2.la-is-in-top_builddir.patch
- 0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.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.10.tar.gz into tmp/arm64-apple-darwin20/ports/libxml2/2.9.10... OK
Running git apply with /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running git apply with /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/patches/libxml2/0002-Remove-script-macro-support.patch... OK
Running git apply with /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK
Running git apply with /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch... OK
Running git apply with /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch... OK
Running 'configure' for libxml2 2.9.10... ERROR, review '/opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/arm64-apple-darwin20/ports/libxml2/2.9.10/configure.log' to see what happened. Last lines are:
========================================================================
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... arm-apple-darwin20.2.0
checking host system type... Invalid configuration `arm64-apple-darwin20': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20 failed
========================================================================
*** 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
--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=/opt/homebrew/Cellar/ruby/3.0.0/bin/$(RUBY_BASE_NAME)
--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-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
/opt/homebrew/lib/ruby/gems/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:402:in `block in execute': Failed to complete configure task (RuntimeError)
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in `chdir'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in `execute'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:110:in `configure'
from /opt/homebrew/lib/ruby/gems/3.0.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:153:in `cook'
from extconf.rb:365:in `block (2 levels) in process_recipe'
from extconf.rb:257:in `block in chdir_for_build'
from extconf.rb:256:in `chdir'
from extconf.rb:256:in `chdir_for_build'
from extconf.rb:364:in `block in process_recipe'
from <internal:kernel>:90:in `tap'
from extconf.rb:262:in `process_recipe'
from extconf.rb:557:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/nokogiri-1.10.10/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/homebrew/lib/ruby/gems/3.0.0/gems/nokogiri-1.10.10 for inspection.
Results logged to /opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/nokogiri-1.10.10/gem_make.out
What are the complete contents of the mkmf.log file generated during the failed installation?
$ cat /opt/homebrew/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/nokogiri-1.10.10/mkmf.log
"clang -fdeclspec -o conftest -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 conftest.c -L. -L/opt/homebrew/Cellar/ruby/3.0.0/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -L. -fstack-protector-strong -L/opt/homebrew/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -m64 -lruby.3.0 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
"clang -fdeclspec -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -m64 -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
"clang -fdeclspec -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=unused-command-line-argument-hard-error-in-future -m64 -Werror -c conftest.c"
error: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Werror,-Wunknown-warning-option]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
have_header: checking for iconv.h... -------------------- yes
"clang -E -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <iconv.h>
/* end */
--------------------
have_library: checking for gzdopen() in -lz... -------------------- yes
"clang -fdeclspec -o conftest -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 conftest.c -L. -L/opt/homebrew/Cellar/ruby/3.0.0/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -L. -fstack-protector-strong -L/opt/homebrew/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -m64 -lruby.3.0 -lz "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <zlib.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: int (* volatile tp)(void)=(int (*)(void))&t;
11: printf("%d", (*tp)());
12: }
13:
14: return !!argv[argc];
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */
--------------------
have_iconv?: checking for iconv using --with-opt-* flags... -------------------- yes
"clang -fdeclspec -o conftest -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 conftest.c -L. -L/opt/homebrew/Cellar/ruby/3.0.0/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -L. -fstack-protector-strong -L/opt/homebrew/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -m64 -lruby.3.0 "
Undefined symbols for architecture arm64:
"_iconv", referenced from:
_main in conftest-ef10e0.o
"_iconv_open", referenced from:
_main in conftest-ef10e0.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <stdlib.h>
4: #include <iconv.h>
5:
6: int main(void)
7: {
8: iconv_t cd = iconv_open("", "");
9: iconv(cd, NULL, NULL, NULL, NULL);
10: return EXIT_SUCCESS;
11: }
/* end */
"clang -fdeclspec -o conftest -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/arm64-darwin20 -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0/ruby/backward -I/opt/homebrew/Cellar/ruby/3.0.0/include/ruby-3.0.0 -I. -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/[email protected]/include -I/opt/homebrew/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 conftest.c -L. -L/opt/homebrew/Cellar/ruby/3.0.0/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -L. -fstack-protector-strong -L/opt/homebrew/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/[email protected]/lib -L/opt/homebrew/opt/readline/lib -m64 -lruby.3.0 -liconv "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <stdlib.h>
4: #include <iconv.h>
5:
6: int main(void)
7: {
8: iconv_t cd = iconv_open("", "");
9: iconv(cd, NULL, NULL, NULL, NULL);
10: return EXIT_SUCCESS;
11: }
/* end */
--------------------
Tell us about your system!
What is the output from ruby -v?
What is the output from gem -v?
What is the output from gem env?
gem env output goes here
If you're using Bundler:
bundle version?bundle config? (Take care to redact any credentials)bundle config output goes here
If you're on MacOS, please note:
gcc -v or clang -vgcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: arm64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Romans-MacBook-Pro-2.local ➜ Tether clang -v
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: arm64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
As a workaround, this works:
gem install nokogiri -- --use-system-libraries
@rgaufman Thanks for reporting this. Can I ask you to help isolate whether this is an M1 problem, a Ruby 3 problem, or a combination of Ruby3 + M1? I unfortunately do not have access to M1 hardware.
I'll further note that we've done quite a bit of work to build native (precompiled) gems which will include M1, if you're willing to wait a day or two then Nokogiri v1.11.0.rc4 should ship a version that you can try.
Ruby 2.7.2 + M1 works for me. Ruby3 does not.
~ % ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
~ % gem install nokogiri
Fetching nokogiri-1.10.10.gem
Fetching mini_portile2-2.4.0.gem
Successfully installed mini_portile2-2.4.0
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.10
Parsing documentation for mini_portile2-2.4.0
Installing ri documentation for mini_portile2-2.4.0
Parsing documentation for nokogiri-1.10.10
Installing ri documentation for nokogiri-1.10.10
Done installing documentation for mini_portile2, nokogiri after 1 seconds
2 gems installed
@samwich Thanks, can you confirm that you're seeing the same errors as @rgaufman when you install with Ruby 3 on M1?
I'm able to install v1.10.10 on Ruby 3 on x86-64-darwin. And another user reported they were able to install on an M1 (though not Ruby 3): https://github.com/sparklemotion/nokogiri/issues/2128#issuecomment-740248091
Yes, I saw the same error when it was trying to build libxml2
checking host system type... Invalid configuration `arm64-apple-darwin20': machine `arm64-apple' not recognized
./libxml2-2.9.10/config.sub doesn't seem to understand what arm64 is, it only has aarch64
@samwich Thanks for confirming. I'm building the v1.11.0.rc4 native gems now (cross-compiling so I'm not seeing the same issues as you) and it would be really helpful if you could try out the arm64 flavor and let me know if it's working for you.
Hey all - v1.11.0.rc4 has been released with pre-compiled native gem support for arm64-darwin. If you get a chance, please kick the tires and let me know here or at #2075 how it goes for you.
gem install nokogiri --prerelease should result in seeing something like:
$ gem install nokogiri --prerelease
Fetching nokogiri-1.11.0.rc4-x86_64-darwin.gem
Successfully installed nokogiri-1.11.0.rc4-x86_64-darwin
1 gem installed
except, you know, it should say arm64-darwin instead of x86_64-darwin.
Yes, works here on Ruby3 on M1 MacBook:
$ gem install nokogiri --prerelease
Fetching nokogiri-1.11.0.rc4-arm64-darwin.gem
Successfully installed nokogiri-1.11.0.rc4-arm64-darwin
Parsing documentation for nokogiri-1.11.0.rc4-arm64-darwin
Installing ri documentation for nokogiri-1.11.0.rc4-arm64-darwin
Done installing documentation for nokogiri after 9 seconds
1 gem installed
@rgaufman OMG that's exciting. Thanks for the feedback!
@rgaufman Could you please also check if it runs (not just installs)? Something like nokogiri http://ct.de
irb(main):001:0' require 'nokogiri'
=> true
irb(main):002:0> Nokogiri::VERSION
=> "1.11.0.rc4"
irb(main):003:0" Nokogiri "http://ct.de"
=> #<Nokogiri::XML::Document:0x104 name="document">
Works for me on M1.
~ % irb
irb(main):001:0> RUBY_VERSION
=> "3.0.0"
irb(main):002:0> require 'nokogiri'
=> true
irb(main):003:0> Nokogiri::VERSION
=> "1.11.0.rc4"
irb(main):004:0> Nokogiri "http://ct.de"
=> #<Nokogiri::XML::Document:0x104 name="document">
irb(main):005:0> `arch`
=> "arm64\n"
irb(main):006:0> `uname -a`
=> "Darwin [***] 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64\n"
irb(main):007:0>
./libxml2-2.9.10/config.subdoesn't seem to understand whatarm64is, it only hasaarch64
This seems like something that needs to be fixed upstream in libxml2 if it's the root cause -- can I ask someone who owns an M1 to do that? I'm also open to PRs patch libxml 2.9.10 to enable Nokogiri to compile on arm64 (see /patches/libxml2 for current examples).
But in the meantime I'm going to close this issue since v1.11.0 enables M1 users to install and run Nokogiri. Thanks all!
Having the exact same issue as OP.
gem install nokogiri seems to be working fine
gem install nokogiri
Successfully installed nokogiri-1.11.1-arm64-darwin
Parsing documentation for nokogiri-1.11.1-arm64-darwin
Done installing documentation for nokogiri after 0 seconds
1 gem installed
but then when I try to run bundle install I got the same error as OP
any suggestions?
@mengqing Thanks for reporting, and sorry you're having this problem. Can you please open a new issue, because the OP had errors during gem install and it looks like you may be having a similar -- but different -- problem. Thank you!
@flavorjones Thanks, will do
@mengqing Hi !
You`re solve your problem ?
@bukharovev please see https://github.com/sparklemotion/nokogiri/issues/2171
Most helpful comment
Having the exact same issue as OP.
gem install nokogiriseems to be working finebut then when I try to run
bundle installI got the same error as OPany suggestions?