How to fix Error running '__rvm_make -j8'

4.2k views Asked by At

I am having issue in installing ruby 2.7.1

I am getting this error:

Error running '__rvm_make -j8',
please read /Users/luqman/.rvm/log/1690926841_ruby-2.7.1/make.log

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

My log file is full of errors which I can't share over here and I am just sharing the starting and end part of it.

The starting part is:

ast.c:115:19: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
    rb_funcall(f, rb_intern("set_encoding"), 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
./include/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
        rb_funcallv(recv, mid, \
                          ^~~
./internal.h:2411:54: note: expanded from macro 'rb_funcallv'
        rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \
                                                     ^~~
ast.c:115:19: note: '{' token is here
    rb_funcall(f, rb_intern("set_encoding"), 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));

Ending part:

linking shared-object socket.bundle
93 warnings generated.
53 warnings generated.
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
13 warnings generated.
linking shared-object ripper.bundle
make: *** [build-ext] Error 2
+__rvm_make:0> return 2

What steps I have done till now:

  • I have reinstalled rvm
  • Updated Brew
  • Upgraded Brew
  • Upgraded OpensSL

I have also tried other solutions from the internet which include

  • Adding a specific path of opensSl like: rvm install 2.7.1 -C --with-openssl-dir=/usr/local/bin/openssl
  • Updated Xcode

My Mac version is Ventura 13.2.1

Nothing has worked, I would really appreciate any help in this regard!

2

There are 2 answers

1
gonczolp On

I bumped into a similar issue today, part of it is brew defaulting to openssl 3 (credit):

brew install [email protected]
rvm install ruby-2.7.1 --with-openssl-dir=$(brew --prefix [email protected])

and my best guess is that the desired ruby version does not support your os version. try something newer (I had to go above 3.x)

0
Burhan Gardezi On

So this worked for me

brew reinstall [email protected] Also check if other openssl versions are installed or not? If so remove them.(like some use openssl@3 which we can configure with our ruby version or vise versa)

brew unlink openssl && brew link [email protected] --force Now I am only installing one openssl and removing the rest

echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc   
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
rvm install ruby-2.7.1 --with-openssl-dir=/usr/local/opt/[email protected] --verify-downloads 1

Also this link might also be helpful for some. rvm make j8 error