Macbook M2Pro - 「__rvm_make -j12」の実行中にエラーが発生しました

概要

「__rvm_make -j12」の実行中にエラーが発生しました。 /Users/scari/.rvm/log/1706650388_ruby-2.7.3/make.log をお読みください。

make の実行中にエラーが発生しました。インストールを中止します。

MacBook m2 pro - Ventura 13.0 に Ruby-2.7.3 をインストールしようとすると

ロゼッタの下を走る2

make.log

 return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6,
ossl.c:311:14: warning: 'ERR_get_error_line_data' is deprecated [-Wdeprecated-declarations]
        while ((e = ERR_get_error_line_data(&file, &line, &data, &flags))) {
/usr/local/Cellar/openssl@3/3.2.0_1/include/openssl/err.h:424:1: note: 'ERR_get_error_line_data' has been explicitly marked deprecated here
    rb_funcall(p->value, rb_intern("compile_error"), 1, str);
    rb_funcall(p->value, rb_intern("compile_error"), 1, str);
    rb_funcall(p->value, rb_intern("compile_error"), 1, str);
    rb_funcall(p->value, rb_intern("compile_error"), 1, str);
    if(!ENGINE_finish(e)) ossl_raise(eEngineError, NULL);
ossl_pkey_rsa.c:942:5: error: use of undeclared identifier 'RSA_SSLV23_PADDING'
115 warnings and 1 error generated.
make[2]: *** [ossl_pkey_rsa.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

解決策

Mac book M2 で Rails アプリをセットアップしていて、rvm install Ruby 3.1.2 を実行した後にこの問題が発生しました。エラーには次のように表示されます。

ログファイルを開いて下にスクロールすると、(いつものように)opensslが記載されていました

openssl のインストール パスに問題があるようです。そのため、このフラグを指定して rvm install を実行するとうまくいき、Ruby バージョンがインストールされました。

RVM インストール 3.1.2 –with-openssl-dir=