json 2.7.3 failed to install with macOS / macPorts / ruby latest
Closed this issue · 7 comments
From bundle update:
current directory: /Users/wlipa/.gem/ruby/3.3.0/gems/json-2.7.3/ext/json/ext/generator
/opt/local/bin/ruby3.3 extconf.rb
checking for whether -std=c99 is accepted as CFLAGS... yes
creating Makefile
current directory: /Users/wlipa/.gem/ruby/3.3.0/gems/json-2.7.3/ext/json/ext/generator
make DESTDIR\= sitearchdir\=./.gem.20241024-95573-4zb0sq sitelibdir\=./.gem.20241024-95573-4zb0sq clean
rm -f
rm -fr generator.bundle generator.bundle.dSYM generator.o *.bak mkmf.log .*.time
current directory: /Users/wlipa/.gem/ruby/3.3.0/gems/json-2.7.3/ext/json/ext/generator
make DESTDIR\= sitearchdir\=./.gem.20241024-95573-4zb0sq sitelibdir\=./.gem.20241024-95573-4zb0sq
/usr/bin/clang -I. -I/opt/local/include/ruby-3.3.5/arm64-darwin24 -I/opt/local/include/ruby-3.3.5/ruby/backward -I/opt/local/include/ruby-3.3.5 -I. -DJSON_GENERATOR -I/opt/local/include -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fno-common -pipe -I/opt/local/libexec/openssl3/include -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -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 -Wmisleading-indentation -Wundef -fno-common -std=c99 -arch arm64 -o generator.o -c generator.c
rm -f generator.bundle
/usr/bin/clang -dynamic -bundle -o generator.bundle generator.o -L. -L/opt/local/lib -L/opt/local/lib -L. -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -fstack-protector-strong -L/opt/local/lib -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -L/opt/local/lib -Wl,-undefined,dynamic_lookup -arch arm64 -lruby.3.3 -lpthread
current directory: /Users/wlipa/.gem/ruby/3.3.0/gems/json-2.7.3/ext/json/ext/generator
make DESTDIR\= sitearchdir\=./.gem.20241024-95573-4zb0sq sitelibdir\=./.gem.20241024-95573-4zb0sq install
/opt/local/bin/gmkdir -p . ./.gem.20241024-95573-4zb0sq/json/ext
make: /opt/local/bin/gmkdir: No such file or directory
make: *** [.sitearchdir.-.json.-.ext.time] Error 1
make install failed, exit code 2
make: /opt/local/bin/gmkdir: No such file or directory
Interesting, not sure why it's trying to use gmkdir
, it's supposed to be for windows.
I haven't changed much if anything there, does gem install json -v 2.7.1
work?
No, that also fails the same way. It's possible I was only using the version of json that came with ruby for a long time, but gems have starting to add explicit dependencies on it, so now I need to update it when I do bundle update.
Interesting. I can't find any match for gmkdir
in either this repo or even ruby/ruby
so I have no idea what may cause this.
A workaround would be to make /opt/local/bin/gmkdir
a symlink to the real mkdir
. But I'm afraid I don't know how to find the root cause of why it's trying to use gmkdir
on your system.
Ah, can you check:
>> RbConfig::CONFIG["MKDIR_P"]
=> "mkdir -p"
I suspect it's wrong on your system.
Yeah, I've got:
> RbConfig::CONFIG["MKDIR_P"]
=> "/opt/local/bin/gmkdir -p"
I suppose that's from the ruby that macports installs. What is this config supposed to be?
Strangely, it's not yet been an issue with other gems with native libs.
Yep, the ruby you installed is broken. The proper value is just "mkdir -p"
, I guess you can just go edit rbconfig.rb
to fix it.
To find it you can run: RbConfig.const_source_location(:CONFIG)
.
Thank you for the help. I did a full reinstall of the MacPorts ruby 3.3.5, and now it's correctly configured and the gem installed without errors.