Due to the age of my MacBook Pro, the most recent operating system I can update to is Big Sur, 11.7.2 (this is the OS the Apple Store genius bar installed for me today). After getting the new OS, I installed a compatible version of the command line tools (12.2). Now, I have tried to install several versions of Ruby using rbenv and they all failed to build.
Trying to install the latest (3.3.0) I got this error,
/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~In file included from apps/lib/app_provider.c:10:In file included from apps/include/apps.h:13:In file included from include/internal/e_os.h:16:In file included from include/openssl/e_os2.h:234:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~In file included from apps/lib/app_params.c:10:In file included from apps/include/apps.h:13:In file included from include/internal/e_os.h:16:In file included from include/openssl/e_os2.h:234:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~In file included from apps/lib/app_rand.c:10:In file included from apps/include/apps.h:13:In file included from include/internal/e_os.h:16:In file included from include/openssl/e_os2.h:234:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h>
Trying to install a version (2.7.2) that I thought might be compatiable based on the release of my OS and the command line tools, I get this error
apps/bf_prefix.c:10:10: fatal error: 'stdio.h' file not found#include <stdio.h> ^~~~~~~~~apps/apps.c:18:10: fatal error: 'stdio.h' file not found#include <stdio.h> ^~~~~~~~~In file included from apps/app_rand.c:10:In file included from apps/apps.h:13:In file included from ./e_os.h:16:In file included from include/openssl/e_os2.h:243:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~In file included from apps/opt.c:9:In file included from apps/apps.h:13:In file included from ./e_os.h:16:In file included from include/openssl/e_os2.h:243:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h>
My version of clang
clang version 5.0.0 (trunk 300079)Target: x86_64-apple-darwin20.6.0Thread model: posixInstalledDir: /usr/local/bin
HOw can I install a more recent version of Ruby other than what comes with the system?
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin20]
UPDATE
full rbenv log for installing ruby 3.3.0
rbenv install 3.3.0==> Downloading openssl-3.1.4.tar.gz...-> curl -q -fL -o openssl-3.1.4.tar.gz https://dqw8nmjcqpjn7.cloudfront.net/840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 14.8M 100 14.8M 0 0 25.7M 0 --:--:-- --:--:-- --:--:-- 25.7M==> Installing openssl-3.1.4...-> ./config "--prefix=$HOME/.rbenv/versions/3.3.0/openssl" "--openssldir=$HOME/.rbenv/versions/3.3.0/openssl/ssl" zlib-dynamic no-ssl3 shared-> make -j 4BUILD FAILED (macOS 11.7.2 on x86_64 using ruby-build 20240119-2-g28d59ac)You can inspect the build directory at /var/folders/5y/wtzzmjlj5v52pg7wr8ptbg_m0000gp/T/ruby-build.20240220103938.12604.Ma5ElpSee the full build log at /var/folders/5y/wtzzmjlj5v52pg7wr8ptbg_m0000gp/T/ruby-build.20240220103938.12604.logMichaels-MacBook-Pro-3:~ mm$ cat /var/folders/5y/wtzzmjlj5v52pg7wr8ptbg_m0000gp/T/ruby-build.20240220103938.12604.logcd /var/folders/5y/wtzzmjlj5v52pg7wr8ptbg_m0000gp/T/ruby-build.20240220103938.12604.Ma5Elp==> Downloading openssl-3.1.4.tar.gz...-> curl -q -fL -o openssl-3.1.4.tar.gz https://dqw8nmjcqpjn7.cloudfront.net/840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3-> tar xzf openssl-3.1.4.tar.gzcd /var/folders/5y/wtzzmjlj5v52pg7wr8ptbg_m0000gp/T/ruby-build.20240220103938.12604.Ma5Elp/openssl-3.1.4==> Installing openssl-3.1.4...-> ./config "--prefix=$HOME/.rbenv/versions/3.3.0/openssl" "--openssldir=$HOME/.rbenv/versions/3.3.0/openssl/ssl" zlib-dynamic no-ssl3 sharedConfiguring OpenSSL version 3.1.4 for target darwin64-x86_64Using os-specific seed configurationCreated configdata.pmRunning configdata.pmCreated Makefile.inCreated MakefileCreated include/openssl/configuration.h************************************************************************* ****** OpenSSL has been successfully configured ****** ****** If you encounter a problem while building, please open an ****** issue on GitHub <https://github.com/openssl/openssl/issues> ****** and include the output from the following command: ****** ****** perl configdata.pm --dump ****** ****** (If you are new to OpenSSL, you might want to consult the ****** 'Troubleshooting' section in the INSTALL.md file first) ****** *************************************************************************-> make -j 4perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1.h.in > include/openssl/asn1.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1t.h.in > include/openssl/asn1t.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/bio.h.in > include/openssl/bio.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cmp.h.in > include/openssl/cmp.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cms.h.in > include/openssl/cms.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/conf.h.in > include/openssl/conf.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crmf.h.in > include/openssl/crmf.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crypto.h.in > include/openssl/crypto.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ct.h.in > include/openssl/ct.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/err.h.in > include/openssl/err.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ess.h.in > include/openssl/ess.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/fipskey.h.in > include/openssl/fipskey.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/lhash.h.in > include/openssl/lhash.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ocsp.h.in > include/openssl/ocsp.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/opensslv.h.in > include/openssl/opensslv.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs12.h.in > include/openssl/pkcs12.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs7.h.in > include/openssl/pkcs7.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/safestack.h.in > include/openssl/safestack.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/srp.h.in > include/openssl/srp.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ssl.h.in > include/openssl/ssl.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ui.h.in > include/openssl/ui.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509.h.in > include/openssl/x509.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509_vfy.h.in > include/openssl/x509_vfy.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509v3.h.in > include/openssl/x509v3.hperl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" test/provider_internal_test.cnf.in > test/provider_internal_test.cnfmake depend && make _build_swclang -I. -Iinclude -Iapps/include -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/ssl\"" -DENGINESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/engines-3\"" -DMODULESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZLIB_SHARED -DNDEBUG -MMD -MF apps/lib/libapps-lib-app_libctx.d.tmp -MT apps/lib/libapps-lib-app_libctx.o -c -o apps/lib/libapps-lib-app_libctx.o apps/lib/app_libctx.cclang -I. -Iinclude -Iapps/include -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/ssl\"" -DENGINESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/engines-3\"" -DMODULESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZLIB_SHARED -DNDEBUG -MMD -MF apps/lib/libapps-lib-app_params.d.tmp -MT apps/lib/libapps-lib-app_params.o -c -o apps/lib/libapps-lib-app_params.o apps/lib/app_params.cclang -I. -Iinclude -Iapps/include -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/ssl\"" -DENGINESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/engines-3\"" -DMODULESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZLIB_SHARED -DNDEBUG -MMD -MF apps/lib/libapps-lib-app_provider.d.tmp -MT apps/lib/libapps-lib-app_provider.o -c -o apps/lib/libapps-lib-app_provider.o apps/lib/app_provider.cclang -I. -Iinclude -Iapps/include -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/ssl\"" -DENGINESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/engines-3\"" -DMODULESDIR="\"/Users/mm/.rbenv/versions/3.3.0/openssl/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZLIB_SHARED -DNDEBUG -MMD -MF apps/lib/libapps-lib-app_rand.d.tmp -MT apps/lib/libapps-lib-app_rand.o -c -o apps/lib/libapps-lib-app_rand.o apps/lib/app_rand.cIn file included from apps/lib/app_libctx.c:9:In file included from apps/include/app_libctx.h:13:In file included from include/openssl/types.h:32:In file included from include/openssl/e_os2.h:234:In file included from /usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~apps/lib/app_provider.c:10:In file included from apps/include/apps.h:13:In file included from include/internal/e_os.h:16:In file included from include/openssl/e_os2.h:234:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~In file included from apps/lib/app_rand.c:10:In file included from apps/include/apps.h:13:In file included from include/internal/e_os.h:16:In file included from include/openssl/e_os2.h:234:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~In file included from apps/lib/app_params.c:10:In file included from apps/include/apps.h:13:In file included from include/internal/e_os.h:16:In file included from include/openssl/e_os2.h:234:/usr/local/lib/clang/5.0.0/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found#include_next <inttypes.h> ^~~~~~~~~~~~1 error generated.1 error generated.make[1]: *** [apps/lib/libapps-lib-app_params.o] Error 1make[1]: *** Waiting for unfinished jobs....make[1]: *** [apps/lib/libapps-lib-app_provider.o] Error 11 error generated.1 error generated.make[1]: *** [apps/lib/libapps-lib-app_rand.o] Error 1make[1]: *** [apps/lib/libapps-lib-app_libctx.o] Error 1make: *** [build_sw] Error 2external command failed with status 2