I'm trying to install ruby 2.7.0 using RVM on MacOS(12.4: apple M2), but i'm getting below error and not able to install required ruby version. I have tried all the solutions available on internet related to openssl but nothing works for me and tried with rbenv also but no luck. Please help me, thank you in advance.
Current version: OpenSSL 1.1.1s 1 Nov 2022
+__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/openssl@1.1/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/openssl@1.1/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 -jApple clang version 14.0.0 (clang-1400.0.29.202)Target: arm64-apple-darwin21.5.0Thread model: posixInstalledDir: /Library/Developer/CommandLineTools/usr/bincompiling ./main.ccompiling dmydln.ccompiling miniinit.ccompiling dmyext.ctranslating probes probes.dcompiling bignum.ccompiling class.ccompiling ast.c. ./vm_opts.hcompiling compar.ccompiling compile.ccompiling complex.ccompiling cont.cbignum.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]