Search code examples
rubyrvm

RVM error while running make install in ruby


While installing the ruby 2.7.2 I'm getting this error:

Error running '__rvm_make -j10',
please read /Users/rifa.fauzi/.rvm/log/1692949367_ruby-2.7.2/make.log

There has been an error while running make. Halting the installation.

And when I checked the make.log file, here's the error: enter image description here

    CFLAGS = -w -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99  -fno-common -pipe 
compiling error.c
compiling regerror.c
./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "gcc  -w -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99  -fno-common -pipe " rb_mjit_header.h .ext/include/arm64-darwin22/rb_mjit_min_header-2.7.2.h
compiling dataerror.c
ossl_pkey_rsa.c:942:5: error: use of undeclared identifier 'RSA_SSLV23_PADDING'
1 error generated.
make[2]: *** [ossl_pkey_rsa.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

Fyi, I installed the ruby using RVM (rvm install 2.7.2) from this: https://rvm.io/rvm/security#alternatives

I already googling about the errors, but still can't find any solution.


Solution

  • Finally, I can solve this problem by following this: https://github.com/postmodern/ruby-install/issues/409#issuecomment-926767470

    In my Mac, the default OpenSSL is version 3 and if based on spickermann answer, Ruby 2.7.x doesn't support OpenSSL 3 and will require OpenSSL 1. Then to fix this issue, you need to uninstall your OpenSSL 3:

    Then install OpenSSL 1 using brew:

    Last, install your ruby 2.7.2 using rvm and OpenSSL 1:

    This solved my issue.