rbenvの更新
$ brew upgrade ruby-build
rbenvでruby 3をインストール
$ rbenv install 3.0.0 Downloading openssl-1.1.1i.tar.gz... -> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242 Installing openssl-1.1.1i... BUILD FAILED (macOS 11.2.1 using ruby-build 20210119) Inspect or clean up the working tree at /var/folders/4t/bm7k_g7d37v5n9vxv6lfzjnh0000gn/T/ruby-build.20210227222639.27074.JMBx8l Results logged to /var/folders/4t/bm7k_g7d37v5n9vxv6lfzjnh0000gn/T/ruby-build.20210227222639.27074.log Last 10 log lines: clang -I. -Iinclude -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/nyan/.rbenv/versions/3.0.0/openssl/ssl\"" -DENGINESDIR="\"/Users/nyan/.rbenv/versions/3.0.0/openssl/lib/engines-1.1\"" -D_REENTRANT -DZLIB -DZLIB_SHARED -DNDEBUG -I/Users/nyan/.rbenv/versions/3.0.0/include -MMD -MF crypto/asn1/x_val.d.tmp -MT crypto/asn1/x_val.o -c -o crypto/asn1/x_val.o crypto/asn1/x_val.c clang -I. -Iinclude -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/nyan/.rbenv/versions/3.0.0/openssl/ssl\"" -DENGINESDIR="\"/Users/nyan/.rbenv/versions/3.0.0/openssl/lib/engines-1.1\"" -D_REENTRANT -DZLIB -DZLIB_SHARED -DNDEBUG -I/Users/nyan/.rbenv/versions/3.0.0/include -MMD -MF crypto/async/arch/async_null.d.tmp -MT crypto/async/arch/async_null.o -c -o crypto/async/arch/async_null.o crypto/async/arch/async_null.c In file included from crypto/async/arch/async_null.c:11: In file included from crypto/async/arch/../async_local.h:24: include/openssl/crypto.h:415:13: fatal error: 'pthread.h' file not found # include <pthread.h> ^~~~~~~~~~~ 1 error generated. make[1]: *** [crypto/async/arch/async_null.o] Error 1 make: *** [all] Error 2
おや?まあ、どうせまたapple clang絡みでしょ・・・、というわけで脳死でbrewでgccをインストール
$ brew install gcc
$ rbenv install 3.0.0 [feature/update_ruby] Downloading openssl-1.1.1i.tar.gz... -> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242 Installing openssl-1.1.1i... Installed openssl-1.1.1i to /Users/nyan/.rbenv/versions/3.0.0 Downloading ruby-3.0.0.tar.gz... -> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz Installing ruby-3.0.0... ruby-build: using readline from homebrew Installed ruby-3.0.0 to /Users/nyan/.rbenv/versions/3.0.0
上手く行ったっぽい