MacOS モントレーで「__rvm_make -j8」を実行するとエラーが発生する
概要
MacOS(12.4:apple M2)上でRVMを使用してruby 2.7.0をインストールしようとしていますが、以下のエラーが発生し、必要なrubyバージョンをインストールできません。 openssl に関連するインターネットで利用可能なすべてのソリューションを試しましたが、何も機能せず、rbenv も試しましたが、うまくいきませんでした。助けてください、よろしくお願いします。
現在のバージョン: OpenSSL 1.1.1s 2022 年 11 月 1 日
+__rvm_make:0> make -j8
BASERUBY = /usr/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99 -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/-darwin21 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-multiply_defined,suppress -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/[email protected]/lib -install_name /Users/rashmib/.rvm/rubies/ruby-2.7.0/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.0 -fstack-protector-strong -framework Security -framework Foundation -fstack-protector-strong -framework Security -framework Foundation
SOLIBS = -lpthread -ldl -lobjc
LANG =
LC_ALL =
LC_CTYPE = UTF-8
MFLAGS = - --jobserver-fds=4,5 -j
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling ast.c
. ./vm_opts.h
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
bignum.c:6127:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
bignum.c:6127:33: note: '{' token is here
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
{ \
^
bignum.c:6127:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
}
^
bignum.c:6127:33: note: ')' token is here
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
class.c:541:13: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
解決策
多くの提案を試した後、次の手順に従うことでうまくいきました