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] Issue installing on Apple M1 Max #2512

Closed
aj7 opened this issue Apr 11, 2022 · 5 comments
Closed

[install] Issue installing on Apple M1 Max #2512

aj7 opened this issue Apr 11, 2022 · 5 comments
Labels
meta/user-help topic/installation Installation difficulties

Comments

@aj7
Copy link

aj7 commented Apr 11, 2022

  • I have tried all the instructions on the below tutorial, looked at issues and cannot figure out why it would not work? (works fine on my Mac intel) . I have libxml2, and zlib both installed also through brew.
  • Shouldn't a native version work on the M1 Max?
  • bundle platform -> Your platform is: -darwin21

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

  • [ x] Yes!

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

Fetching nokogiri 1.13.2
Installing nokogiri 1.13.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/useruser/.rvm/gems/ruby-2.6.5/gems/nokogiri-1.13.2/ext/nokogiri
/Users/useruser/.rvm/rubies/ruby-2.6.5/bin/ruby -I /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r
./siteconf20220411-89943-12ml3ez.rb extconf.rb --use-system-libraries
checking for whether -I/opt/homebrew/opt/libxml2/include is accepted as CPPFLAGS... yes
checking for whether -L/opt/homebrew/opt/libxml2/lib is accepted as LDFLAGS... yes
checking for whether -std=c99 is accepted as CFLAGS... yes
checking for whether -Wno-declaration-after-statement is accepted as CFLAGS... yes
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
checking for whether -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 is accepted as CPPFLAGS... yes
Building nokogiri using system libraries.
checking for gzdopen() in -lz... no
checking for gzdopen() in -llibz... no
checking for zlib using `pkg_config`... yes: ["", "", "-lz"]
checking for gzdopen() in -lz... no
checking for gzdopen() in -llibz... no
-----
extconf.rb:285:in `ensure_package_configuration'
extconf.rb:645:in `<main>'
z 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
	--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=/Users/useruser/.rvm/rubies/ruby-2.6.5/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
	--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-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-zlib
	--without-zlib
	--with-libzlib
	--without-libzlib
	--with-zlib-config
	--without-zlib-config
	--with-pkg-config
	--without-pkg-config
	--with-zlib
	--without-zlib
	--with-libzlib
	--without-libzlib

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

  /Users/useruser/.rvm/gems/ruby-2.6.5/extensions/-darwin-21/2.6.0/nokogiri-1.13.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/useruser/.rvm/gems/ruby-2.6.5/gems/nokogiri-1.13.2 for inspection.
Results logged to /Users//.rvm/gems/ruby-2.6.5/extensions/-darwin-21/2.6.0/nokogiri-1.13.2/gem_make.out

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

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

If installation completed but is broken, what is the complete output from nokogiri -v?

did not work

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

block in append_cppflags: checking for whether -I/opt/homebrew/opt/libxml2/include is accepted as CPPFLAGS... -------------------- yes

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib     -lruby.2.6   "
ld: warning: ignoring file /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -E -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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/opt/homebrew/opt/libxml2/include conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

block in append_ldflags: checking for whether -L/opt/homebrew/opt/libxml2/lib is accepted as LDFLAGS... -------------------- yes

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib     -lruby.2.6 -L/opt/homebrew/opt/libxml2/lib  "
ld: warning: ignoring file /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

block in append_cflags: checking for whether -std=c99 is accepted as CFLAGS... -------------------- yes

"gcc -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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  -std=c99 -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

block in append_cflags: checking for whether -Wno-declaration-after-statement is accepted as CFLAGS... -------------------- yes

"gcc -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99  -Wno-declaration-after-statement -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

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

"gcc -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement  -g -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

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

"gcc -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g  -Winline -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

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

"gcc -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline  -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 0;
6: }
/* end */

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

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

"gcc -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  -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 0;
6: }
/* end */

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

block in append_cppflags: checking for whether -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 is accepted as CPPFLAGS... -------------------- yes

"gcc -E -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn -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: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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

have_library: checking for gzdopen() in -lz... -------------------- no

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib     -lruby.2.6 -lz   "
ld: warning: ignoring file /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/zlib/lib/libz.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_gzdopen", referenced from:
      _t in conftest-cdc8e6.o
ld: symbol(s) not found for architecture x86_64
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 <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 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib     -lruby.2.6 -lz   "
conftest.c:16:13: error: conflicting types for 'gzdopen'
extern void gzdopen();
            ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: previous declaration is here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
conftest.c:17:23: error: too few arguments to function call, expected 2, have 0
int t(void) { gzdopen(); return 0; }
              ~~~~~~~ ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: 'gzdopen' declared here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
2 errors generated.
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 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

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

have_library: checking for gzdopen() in -llibz... -------------------- no

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib     -lruby.2.6 -llibz   "
ld: library not found for -llibz
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 <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 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib     -lruby.2.6 -llibz   "
conftest.c:16:13: error: conflicting types for 'gzdopen'
extern void gzdopen();
            ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: previous declaration is here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
conftest.c:17:23: error: too few arguments to function call, expected 2, have 0
int t(void) { gzdopen(); return 0; }
              ~~~~~~~ ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: 'gzdopen' declared here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
2 errors generated.
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 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

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

try_package_configuration: checking for zlib using `pkg_config`... -------------------- yes: ["", "", "-lz"]

"pkg-config --exists zlib"
| pkg-config --libs zlib
=> "-lz\n"
"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I. -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib     -lruby.2.6 -lz  "
ld: warning: ignoring file /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/zlib/lib/libz.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I zlib
=> "\n"
| pkg-config --cflags-only-other zlib
=> "\n"
| pkg-config --libs-only-l zlib
=> "-lz\n"
package configuration for zlib
cflags: 
ldflags: 
libs: -lz

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

have_library: checking for gzdopen() in -lz... -------------------- no

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I.  -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib      -lz -lruby.2.6 -lz  -lz  "
ld: warning: ignoring file /opt/homebrew/opt/zlib/lib/libz.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_gzdopen", referenced from:
      _t in conftest-04c543.o
ld: symbol(s) not found for architecture x86_64
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 <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 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I.  -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib      -lz -lruby.2.6 -lz  -lz  "
conftest.c:16:13: error: conflicting types for 'gzdopen'
extern void gzdopen();
            ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: previous declaration is here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
conftest.c:17:23: error: too few arguments to function call, expected 2, have 0
int t(void) { gzdopen(); return 0; }
              ~~~~~~~ ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: 'gzdopen' declared here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
2 errors generated.
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 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

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

have_library: checking for gzdopen() in -llibz... -------------------- no

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I.  -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib      -lz -lruby.2.6 -llibz  -lz  "
ld: library not found for -llibz
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 <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 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/-darwin21 -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/backward -I/Users/useruser/.rvm/rubies/ruby-2.6.5/include/ruby-2.6.0 -I.  -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/homebrew/opt/libxml2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 -Wno-error=implicit-function-declaration -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -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 -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  conftest.c  -L. -L/Users/useruser/.rvm/rubies/ruby-2.6.5/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L. -L/opt/homebrew/opt/libffi/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/libxml2/lib      -lz -lruby.2.6 -llibz  -lz  "
conftest.c:16:13: error: conflicting types for 'gzdopen'
extern void gzdopen();
            ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: previous declaration is here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
conftest.c:17:23: error: too few arguments to function call, expected 2, have 0
int t(void) { gzdopen(); return 0; }
              ~~~~~~~ ^
/opt/homebrew/opt/zlib/include/zlib.h:1340:24: note: 'gzdopen' declared here
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
                       ^
2 errors generated.
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 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

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


Tell us about your system!

What is the output from ruby -v?
ruby 2.6.5p114 (2019-10-01 revision 67812) [-darwin21]

What is the output from gem -v?
3.0.9
What is the output from gem env?

RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.9
  - RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [-darwin21]
  - INSTALLATION DIRECTORY: /Users/useruser/.rvm/gems/ruby-2.6.5
  - USER INSTALLATION DIRECTORY: /Users/useruser/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /Users/useruser/.rvm/rubies/ruby-2.6.5/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /Users/useruser/.rvm/gems/ruby-2.6.5/bin
  - SPEC CACHE DIRECTORY: /Users/useruser/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/useruser/.rvm/rubies/ruby-2.6.5/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - -darwin-21
  - GEM PATHS:
     - /Users/useruser/.rvm/gems/ruby-2.6.5
     - /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /opt/homebrew/opt/libxslt/bin
     - /opt/homebrew/opt/libxml2/bin
     - /Users/useruser/.yarn/bin
     - /Users/useruser/.config/yarn/global/node_modules/.bin
     - /opt/homebrew/opt/postgresql@10/bin
     - /Users/useruser/bin
     - /usr/local/bin
     - /Users/useruser/.nvm/versions/node/v12.22.9/bin
     - /Users/useruser/.rvm/gems/ruby-2.6.5/bin
     - /Users/useruser/.rvm/gems/ruby-2.6.5@global/bin
     - /Users/useruser/.rvm/rubies/ruby-2.6.5/bin
     - /Users/useruser/.rvm/bin
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Applications/Postgres.app/Contents/Versions/latest/bin

If you're using Bundler:

  • what is the output from bundle version? Bundler version 1.17.3 (2020-12-09 commit d7089abb6a)
  • what is the output from bundle config? (Take care to redact any credentials)
the output of "bundle config" goes here

If you're on MacOS, please note:

  • the version of XCode you have installed (if you know)
  • the output of gcc -v or clang -v

gcc -v
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

If Linux or a BSD variant, please note:

  • the distro you're using
  • the output of uname -a
  • the contents of /etc/lsb-release.

If Windows, please note:

  • whether you're installing the precompiled gems, or compiling yourself with DevKit
  • the version of RubyInstaller you've installed
  • or if you're not using RubyInstaller, how did you install Ruby?
@aj7 aj7 added the topic/installation Installation difficulties label Apr 11, 2022
@flavorjones
Copy link
Member

@aj7 Sorry you're having problems, I'll try to help.

Something looks broken on your machine. The output of gem env shows platforms ruby (which is right) and -darwin-21 (which is not right). For comparison, on my M1 the output of gem env contains:

  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-21

and you can see that the CPU is part of the platform name on mine (which is correct). If you want the native (precompiled) gem to work, you'll need to figure out what's going on there.

Potentially related, there are architecture warnings in the output of mkmf.log:

ld: warning: ignoring file /opt/homebrew/opt/zlib/lib/libz.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /Users/useruser/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_gzdopen", referenced from:
      _t in conftest-04c543.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't know much about Macs, but it is possible you copied files from a previous intel mac? Or that something is going on with conflicting Rosetta and non-Rosetta installations of Ruby?

@larskanis
Copy link
Member

I think the ruby version 2.6.5 is too old to run on M1. It seems that ruby-2.6.8 is required at least: ffi/ffi#922 (comment)

@aj7
Copy link
Author

aj7 commented Apr 11, 2022

thanks @larskanis and @flavorjones - makes sense and I will look into it...was resisting upgrading ruby version to avoid application breaks....i've quite convinced this is what it should be...i will close this now!

@aj7 aj7 closed this as completed Apr 11, 2022
@tyagi-manan
Copy link

hi @aj7 is this worked ?, I also facing exactly same issue

@flavorjones
Copy link
Member

@tyagi-manan Please open a new issue or discussion if you're having problems. Thanks.

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

No branches or pull requests

4 participants