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

[install] Installation Nokogiri 1.11.2 fails on Apple M1 with Ruby 3.0.1 #2216

Closed
1 task done
deepj opened this issue Apr 7, 2021 · 2 comments
Closed
1 task done
Labels
topic/installation Installation difficulties

Comments

@deepj
Copy link

deepj commented Apr 7, 2021

Have you read and followed the installation tutorial at http://www.nokogiri.org/tutorials/installing_nokogiri.html?

  • Yes!

What is the complete output of gem install or bundle install?

bundle
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Using rake 13.0.3
Using concurrent-ruby 1.1.8
Using minitest 5.14.4
Using nio4r 2.5.7
Using zeitwerk 2.4.2
Using mini_mime 1.0.3
Using erubi 1.10.0
Using public_suffix 4.0.6
Using ruby2_keywords 0.0.4
Using net-ssh 6.1.0
Using alba 0.13.1
Using thread_safe 0.3.6
Using ast 2.4.2
Using geocoder 1.6.6
Using method_source 1.0.0
Using thor 1.1.0
Using bcrypt 3.1.16
Using bcrypt_pbkdf 1.1.0
Using bindex 0.8.1
Using msgpack 1.4.2
Using brakeman 4.10.1
Using bundler 2.2.15
Using cancancan 3.2.1
Using regexp_parser 2.1.1
Using capybara-choices 0.1.0
Using childprocess 3.0.0
Using choice 0.2.0
Using chronic 0.10.2
Using connection_pool 2.2.3
Using dead_end 1.1.6
Using orm_adapter 0.5.0
Using docile 1.3.5
Using unf_ext 0.0.7.7
Using racc 1.5.2
Using dotenv 2.7.6
Using dry-inflector 0.2.0
Using ice_nine 0.11.2
Using dry-transformer 0.1.1
Using ed25519 1.2.4
Using http-form_data 2.3.0
Using ffi 1.15.0
Using faraday-net_http 1.0.1
Using multipart-post 2.1.1
Using slop 4.8.2
Using systemu 2.6.5
Using rb-fsevent 0.10.4
Using maxminddb 0.1.22
Using mocha 1.12.0
Using nats-pure 0.6.2
Using pagy 4.1.0
Using parallel 1.20.1
Using pg 1.2.3
Using rexml 3.2.5
Using tilt 2.0.10
Using rainbow 3.0.0
Using redis 4.2.5
Using rubyzip 2.3.0
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.0.0
Using semantic_range 3.0.0
Using simplecov-html 0.12.3
Using simplecov_json_formatter 0.1.2
Using temple 0.8.2
Using smarter_csv 1.2.8
Using state_machine 1.2.0
Using state_machines 0.5.0
Using turbolinks-source 5.2.0
Using i18n 1.8.10
Using tzinfo 2.0.4
Using ruby_event_store 2.1.0
Using dry-core 0.5.0
Using minitest-retry 0.2.1
Using puma 5.2.2
Using mail 2.7.1
Using addressable 2.7.0
Using net-scp 3.0.0
Using marcel 1.0.1
Using bootsnap 1.7.3
Using bundler-audit 0.8.0
Using crass 1.0.6
Using mustermann 1.1.1
Using dry-equalizer 0.3.0
Using whenever 1.0.0
Using activesupport 6.1.3.1
Using aggregate_root 2.1.0
Using dry-configurable 0.12.1
Using dry-logic 1.1.0
Using rack 2.2.3
Using ffi-compiler 1.0.1
Using faraday 1.3.0
Using macaddr 1.7.2
Using rb-inotify 0.10.1
Using ruby-graphviz 1.2.5
Using selenium-webdriver 3.142.7
Using simplecov 0.21.2
Using slim 4.1.0
Using turbolinks 5.2.1
Using tzinfo-data 1.2021.1
Using validates_email_format_of 1.6.3
Using sshkit 1.21.2
Using launchy 2.5.0
Using globalid 0.4.2
Using activemodel 6.1.3.1
Using carmen 1.1.3
Using dry-monads 1.3.5
Using factory_bot 6.1.0
Using jbuilder 2.11.2
Using dry-container 0.7.2
Using builder 3.2.4
Using websocket-extensions 0.1.5
Using unf 0.1.4
Using mini_portile2 2.5.0
Using rack-test 1.1.0
Using websocket-driver 0.7.3
Using activejob 6.1.3.1
Using activerecord 6.1.3.1
Using airbrussh 1.4.0
Using warden 1.2.9
Using sshkit-interactive 0.3.0
Using domain_name 0.5.20190701
Using dry-types 1.5.1
Using http-parser 1.2.3
Using uuid 2.3.9
Using letter_opener 1.7.0
Using listen 3.5.1
Using request_store 1.5.0
Using rack-attack 6.5.0
Using rack-protection 2.1.0
Using rack-proxy 0.6.5
Using sentry-ruby-core 4.3.1
Using sidekiq 6.2.0
Using state_machines-activemodel 0.8.0
Using parser 3.0.1.0
Using arkency-command_bus 0.4.0
Fetching nokogiri 1.11.2
Using activerecord-import 1.0.8
Using ancestry 3.2.1
Using capistrano 3.16.0
Using dry-struct 1.4.0
Using http-cookie 1.0.3
Using rails-erd 1.6.1
Using sinatra 2.1.0
Using rubocop-ast 1.4.1
Using sentry-ruby 4.3.1
Using sentry-sidekiq 4.3.0
Using state_machines-activerecord 0.8.0
Using store_model 0.8.2
Using capistrano-bundler 2.0.1
Using capistrano-passenger 0.2.1
Using capistrano-rails 1.6.1
Using capistrano-shell 0.2.0
Using http 4.4.1
Using rails_event_store_active_record 2.1.0
Using elastic-apm 3.15.1
Using ruby_event_store-browser 2.1.0
Using rubocop 1.12.1
Using capistrano-rails-console 2.3.0
Using rails_event_store 2.1.0
Using rubocop-performance 1.10.2
Using rubocop-rails 2.9.1
Installing nokogiri 1.11.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/ext/nokogiri
~/.rubies/ruby-3.0.1/bin/ruby -I ~/.rubies/ruby-3.0.1/lib/ruby/3.0.0 -r ./siteconf20210407-43623-ylvto7.rb extconf.rb
checking for whether -g is accepted as CFLAGS... yes
checking for whether -Winline is accepted as CFLAGS... yes
checking for whether -Wmissing-noreturn is accepted as CFLAGS... yes
checking for whether -Wno-error=unused-command-line-argument-hard-error-in-future is accepted as CFLAGS... no
Building nokogiri using packaged libraries.
Static linking is enabled.
Cross build is disabled.
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
Using mini_portile version 2.5.0
checking for iconv... yes
---------- IMPORTANT NOTICE ----------
Building Nokogiri with a packaged version of libxml2-2.9.10.
Configuration options: --host\=arm64-apple-darwin20 --enable-static --disable-shared --libdir\=~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/ports/arm64-apple-darwin20/libxml2/2.9.10/lib
--with-iconv\=yes --without-python --without-readline --with-c14n --with-debug --with-threads --disable-shared --enable-static RANLIB\=/usr/bin/ranlib AR\=/usr/bin/ar CFLAGS\=-O2\ -U_FORTIFY_SOURCE\ -g\
-fPIC
The following patches are being 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
  - 0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch
  - 0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch
  - 0008-use-glibc-strlen.patch
  - 0009-avoid-isnan-isinf.patch
  - 0010-parser.c-shrink-the-input-buffer-when-appropriate.patch

The Nokogiri maintainers intend to provide timely security updates, but if
this is a concern for you and want to use your OS/distro system library
instead, then abort this installation process and install nokogiri as
instructed at:

  https://nokogiri.org/tutorials/installing_nokogiri.html#installing-using-standard-system-libraries

Note, however, that nokogiri cannot guarantee compatiblity with every
version of libxml2 that may be 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 ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0002-Remove-script-macro-support.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0008-use-glibc-strlen.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0009-avoid-isnan-isinf.patch... OK
Running git apply with ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/patches/libxml2/0010-parser.c-shrink-the-input-buffer-when-appropriate.patch... OK
Running 'configure' for libxml2 2.9.10... ERROR, review '~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2/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.3.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
	--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=~/.rubies/ruby-3.0.1/bin/$(RUBY_BASE_NAME)
	--help
	--clean
	--prevent-strip
	--enable-system-libraries
	--disable-system-libraries
	--use-system-libraries
	--enable-system-libraries
	--disable-system-libraries
	--use-system-libraries
	--enable-static
	--disable-static
	--enable-cross-build
	--disable-cross-build
	--with-zlib-dir
	--without-zlib-dir
	--with-zlib-include
	--without-zlib-include=${zlib-dir}/include
	--with-zlib-lib
	--without-zlib-lib=${zlib-dir}/lib
	--with-iconv-dir
	--without-iconv-dir
	--with-iconv-include
	--without-iconv-include=${iconv-dir}/include
	--with-iconv-lib
	--without-iconv-lib=${iconv-dir}/lib
~/.gem/ruby/3.0.1/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:405:in `block in execute': Failed to complete configure task (RuntimeError)
	from ~/.gem/ruby/3.0.1/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:376:in `chdir'
	from ~/.gem/ruby/3.0.1/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:376:in `execute'
	from ~/.gem/ruby/3.0.1/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:110:in `configure'
	from ~/.gem/ruby/3.0.1/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:153:in `cook'
	from extconf.rb:507:in `block (2 levels) in process_recipe'
	from extconf.rb:290:in `block in chdir_for_build'
	from extconf.rb:289:in `chdir'
	from extconf.rb:289:in `chdir_for_build'
	from extconf.rb:506:in `block in process_recipe'
	from <internal:kernel>:90:in `tap'
	from extconf.rb:409:in `process_recipe'
	from extconf.rb:744:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  ~/.gem/ruby/3.0.1/extensions/arm64-darwin-20/3.0.0/nokogiri-1.11.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in ~/.gem/ruby/3.0.1/gems/nokogiri-1.11.2 for inspection.
Results logged to ~/.gem/ruby/3.0.1/extensions/arm64-darwin-20/3.0.0/nokogiri-1.11.2/gem_make.out

An error occurred while installing nokogiri (1.11.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.11.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  actioncable was resolved to 6.1.3.1, which depends on
    actionpack was resolved to 6.1.3.1, which depends on
      actionview was resolved to 6.1.3.1, which depends on
        rails-dom-testing was resolved to 2.0.3, which depends on
          nokogiri

If installation failed during compilation, what are the complete contents of the mkmf.log file generated during the failed installation?

block in append_cflags: checking for whether -g is accepted as CFLAGS... -------------------- yes

"clang -fdeclspec -o conftest -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 conftest.c  -L. -L~/.rubies/ruby-3.0.1/lib -L. -L~/.rubies/ruby-3.0.1/lib  -fstack-protector-strong -L/usr/local/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~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -m64 -g -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

--------------------

block in append_cflags: checking for whether -Winline is accepted as CFLAGS... -------------------- yes

"clang -fdeclspec -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -m64 -Winline -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

--------------------

block in append_cflags: checking for whether -Wmissing-noreturn is accepted as CFLAGS... -------------------- yes

"clang -fdeclspec -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -Winline -m64 -Wmissing-noreturn -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

--------------------

block in append_cflags: checking for whether -Wno-error=unused-command-line-argument-hard-error-in-future is accepted as CFLAGS... -------------------- no

"clang -fdeclspec -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -Winline -Wmissing-noreturn -m64 -Wno-error=unused-command-line-argument-hard-error-in-future -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(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

--------------------

have_header: checking for iconv.h... -------------------- yes

"clang -E -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -Winline -Wmissing-noreturn  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~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -Winline -Wmissing-noreturn conftest.c  -L. -L~/.rubies/ruby-3.0.1/lib -L. -L~/.rubies/ruby-3.0.1/lib  -fstack-protector-strong -L/usr/local/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 */

--------------------

try_link_iconv: checking for iconv... -------------------- yes

"clang -fdeclspec -o conftest -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -Winline -Wmissing-noreturn conftest.c  -L. -L~/.rubies/ruby-3.0.1/lib -L. -L~/.rubies/ruby-3.0.1/lib  -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.3.0   "
Undefined symbols for architecture arm64:
  "_iconv", referenced from:
      _main in conftest-9956c1.o
  "_iconv_open", referenced from:
      _main in conftest-9956c1.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: int main(void)
 6: {
 7:     iconv_t cd = iconv_open("", "");
 8:     iconv(cd, NULL, NULL, NULL, NULL);
 9:     return EXIT_SUCCESS;
10: }
/* end */

"clang -fdeclspec -o conftest -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/arm64-darwin20 -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I~/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I~/.rubies/ruby-3.0.1/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 -g -Winline -Wmissing-noreturn conftest.c  -L. -L~/.rubies/ruby-3.0.1/lib -L. -L~/.rubies/ruby-3.0.1/lib  -fstack-protector-strong -L/usr/local/lib  -m64   -lruby.3.0 -liconv  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <stdlib.h>
 4: #include <iconv.h>
 5: int main(void)
 6: {
 7:     iconv_t cd = iconv_open("", "");
 8:     iconv(cd, NULL, NULL, NULL, NULL);
 9:     return EXIT_SUCCESS;
10: }
/* end */

--------------------

Tell us about your system!

RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.15
  - RUBY VERSION: 3.0.1 (2021-04-05 patchlevel 64) [arm64-darwin20]
  - INSTALLATION DIRECTORY: ~/.gem/ruby/3.0.1
  - USER INSTALLATION DIRECTORY: ~/.gem/ruby/3.0.0
  - RUBY EXECUTABLE: ~/.rubies/ruby-3.0.1/bin/ruby
  - GIT EXECUTABLE: /opt/homebrew/bin/git
  - EXECUTABLE DIRECTORY: ~/.gem/ruby/3.0.1/bin
  - SPEC CACHE DIRECTORY: ~/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: ~/.rubies/ruby-3.0.1/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-20
  - GEM PATHS:
     - ~/.gem/ruby/3.0.1
     - ~/.rubies/ruby-3.0.1/lib/ruby/gems/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - ~/.gem/ruby/3.0.1/bin
     - ~/.rubies/ruby-3.0.1/lib/ruby/gems/3.0.0/bin
     - ~/.rubies/ruby-3.0.1/bin
     - /opt/homebrew/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

If you're using Bundler:

  • what is the output from bundle version?
  • what is the output from bundle config? (Take care to redact any credentials)
Bundler version 2.2.15

There is no issue with Ruby 3.0.0 on the same system and setup. Both Ruby are installed via ruby-build.

@deepj deepj added the topic/installation Installation difficulties label Apr 7, 2021
@deepj deepj changed the title [install] Installtion Nokogiri 1.11.2 fails on Apple M1 with Ruby 3.0.1 [install] Installation Nokogiri 1.11.2 fails on Apple M1 with Ruby 3.0.1 Apr 7, 2021
@flavorjones
Copy link
Member

Hi @deepj, sorry you're having problems. I'll try to help.

As I mentioned in the other issue, your output tells me that the native (precompiled) gem isn't being installed. Instead, bundler is choosing the vanilla ruby platform gem and trying to compile it.

Compilation won't work on M1 until #2214 lands in a release (soon!). But let's look at why bundler isn't doing the right thing ...

Can you share your Gemfile.lock? Can you reproduce this with a simpler Gemfile (containing only Nokogiri)? Are you able to gem install nokogiri (that is, does gem install choose the right native platform gem)?

@deepj
Copy link
Author

deepj commented Apr 8, 2021

@flavorjones Hello. Please, don't apologize. I noticed Nokogiri 1.11.3 has been released and it looks it solves the problem. now

Fetching nokogiri 1.11.3 (arm64-darwin)
Using activerecord-import 1.0.8
Using ancestry 3.2.1
Using rubocop-performance 1.10.2
Using capistrano 3.16.0
Using rubocop-rails 2.9.1
Using state_machines-activerecord 0.8.0
Using store_model 0.8.2
Using elastic-apm 3.15.1
Using rails-erd 1.6.1
Using rails_event_store_active_record 2.1.0
Using capistrano-passenger 0.2.1
Using capistrano-rails-console 2.3.0
Using capistrano-shell 0.2.0
Using capistrano-bundler 2.0.1
Using capistrano-rails 1.6.1
Using rails_event_store 2.1.0
Installing alba 1.0.0
Installing sentry-ruby-core 4.3.2
Installing sidekiq 6.2.1
Using sentry-sidekiq 4.3.0
Fetching sentry-ruby 4.3.2
Installing sentry-ruby 4.3.2
Installing nokogiri 1.11.3 (arm64-darwin)

Feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/installation Installation difficulties
Projects
None yet
Development

No branches or pull requests

2 participants