macOSデフォルトのrubyバージョンは2.6だったので、最新版rubyをrvmで入れようとした時のできことです。
$ rvm install 3.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/14.2/arm64/ruby-3.3.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system - please wait
...
中略
...
ruby-3.3.0 - #extracting ruby-3.3.0 to /Users/user/.rvm/src/ruby-3.3.0 - please wait
ruby-3.3.0 - #autogen.sh - please wait
ruby-3.3.0 - #configuring - please wait
ruby-3.3.0 - #post-configuration - please wait
ruby-3.3.0 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/user/.rvm/log/1704109734_ruby-3.3.0/make.log
There has been an error while running make. Halting the installation.
ログを見てみると、次のようにopenssl絡みのエラーっぽいですね。(というのは、後から分かりました。笑)
./openssl_missing.h:230:41: note: expanded from macro 'EVP_MD_CTX_get_pkey_ctx'
# define EVP_MD_CTX_get_pkey_ctx(x) (x)->pctx
~~~^
/opt/homebrew/Cellar/openssl@3/3.2.0_1/include/openssl/types.h:107:16: note: forward declaration of 'struct evp_md_ctx_st'
typedef struct evp_md_ctx_st EVP_MD_CTX;
^
1 warning and 1 error generated.
make[2]: *** [ossl_hmac.o] Error 1
make[2]: *** Waiting for unfinished jobs....
compiling syslog.c
compiling zlib.c
linking shared-object stringio.bundle
In file included from ossl_kdf.c:5:
In file included from ./ossl.h:175:
./openssl_missing.h:195:11: warning: 'TS_VERIFY_CTS_set_certs' macro redefined [-Wmacro-redefined]
# define TS_VERIFY_CTS_set_certs(ctx, crts) ((ctx)->certs=(crts))
^
/opt/homebrew/Cellar/openssl@3/3.2.0_1/include/openssl/ts.h:426:11: note: previous definition is here
# define TS_VERIFY_CTS_set_certs(ctx, cert) TS_VERIFY_CTX_set_certs(ctx,cert)
^
linking shared-object strscan.bundle
1 warning generated.
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
はい、もう結論です。「Building ruby on mac m1 #5252」を参考に次のでインストールできました〜
rvm install 3.2.2 --with-openssl-dir=$(brew --prefix)/opt/openssl@3
こちらのコマンド通り、結局最新版じゃなくなりましたが、3.3でも同じので行けるではないかと思われます。
コメントを残す