Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rvm install "ruby-2.5.1" --Error running '__rvm_make -j10', in MAC OS Monterey 12.4 #5240

Open
ravisankarofp opened this issue Jul 29, 2022 · 18 comments

Comments

@ravisankarofp
Copy link

ravisankarofp commented Jul 29, 2022

Below is the error i am facing while installig ruby-2.5.1. Please note that i have to install only this specific version of ruby. Appreciate if anyone can provide hints/clues to solve this issue?

Error running '__rvm_make -j10',
please read /Users/ravisankar/.rvm/log/1658948998_ruby-2.5.1/make.log

@Bardiamist
Copy link

Same issue on rvm install 2.7.5 on macOS 12.5

@ravisankarofp
Copy link
Author

Below solution worked for me...
In the terminal, execute below commands in sequence

export warnflags=-Wno-error=implicit-function-declaration
rvm install ruby-2.5.1

Please give it a try.
Screenshot 2022-08-04 at 5 38 41 PM

Even though status looks broken, but i am able to build my rails code and run the server successfully.

@sometimescasey
Copy link

Was installing Ruby 3.0.0 on Mac OS Monterey with an M2 chip. I recommend actually reading the error in the log because I had to try a couple of different things to finally get this to work, and I'm not 100% sure which one actually did the trick:

First error:

closure.c:265:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);
             ^
1 error generated.

It looks like @ravisankarofp's suggestion was meant to address this but unfortunate that didn't work for me. This did, however:

https://stackoverflow.com/a/68351730/3700490

I then got this error:

readline.c:1904:37: error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'?
                                    rl_username_completion_function);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    rl_username_completion_function
readline.c:79:42: note: expanded from macro 'rl_username_completion_function'

So then I read https://stackoverflow.com/a/67249174/3700490 and the following resulted in a successful install:

arch -x86_64 rvm install 3.0.0

I'll report back if this results in a broken Ruby install.

@evgeny-danilov
Copy link

I experienced the same issue with ruby 2.7.1, when I changed the machine. I changed the version to 2.7.8 and it solved the problem.

@mathieujobin
Copy link
Contributor

try -j2 instead, -j10 is a lot of core, that's why it gets killed

@skqist225
Copy link

Below solution worked for me... In the terminal, execute below commands in sequence

export warnflags=-Wno-error=implicit-function-declaration rvm install ruby-2.5.1

Please give it a try. Screenshot 2022-08-04 at 5 38 41 PM

Even though status looks broken, but i am able to build my rails code and run the server successfully.

Thanks for your solution. That works in my case.

@muriithiKabogo
Copy link

Thanks th

Below solution worked for me... In the terminal, execute below commands in sequence

export warnflags=-Wno-error=implicit-function-declaration rvm install ruby-2.5.1

Please give it a try. Screenshot 2022-08-04 at 5 38 41 PM

Even though status looks broken, but i am able to build my rails code and run the server successfully.

This worked for me. Using a macbook pro M1

@hballangan-mdsol
Copy link

hballangan-mdsol commented Jul 21, 2023

arch -x86_64 rvm install 3.0.0

didn't work for me
arch -arm64 rvm install 3.2.2

@Alex808r
Copy link

Alex808r commented Jul 27, 2023

Mac M1 Monterey

rvm install 3.2.0 => Error running '__rvm_make -j8'

I solved the problem like this

  1. rvm remove 3.2.0
  2. rvm cleanup all
  3. rvm reinstall 3.2.0 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --disable-dtrace --disable-docs

@k-vikram
Copy link

Was installing Ruby 3.0.0 on Mac OS Monterey with an M2 chip. I recommend actually reading the error in the log because I had to try a couple of different things to finally get this to work, and I'm not 100% sure which one actually did the trick:

First error:

closure.c:265:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);
             ^
1 error generated.

It looks like @ravisankarofp's suggestion was meant to address this but unfortunate that didn't work for me. This did, however:

https://stackoverflow.com/a/68351730/3700490

I then got this error:

readline.c:1904:37: error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'?
                                    rl_username_completion_function);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    rl_username_completion_function
readline.c:79:42: note: expanded from macro 'rl_username_completion_function'

So then I read https://stackoverflow.com/a/67249174/3700490 and the following resulted in a successful install:

arch -x86_64 rvm install 3.0.0

I'll report back if this results in a broken Ruby install.

@sometimescasey Super thanks for the pointer! I am on Mac M2 chipset and I was facing the __rvm_make -j8 error without remedy. This stackoverflow answer, more so the idea to chuck rvm and go for rbenv worked for me. After spending more than 6-7hours , rbenv did the trick!

@gabeodess
Copy link

Okay, after running into this a number of times I've finally figured out my issues, so I'll document them here.

This is on a 2021 M1 MacBook Pro.

To @sometimescasey 's point, you should review your log file to determine specifically which issues you are facing.

My first error like some of the above comments was:

closure.c:264:14: error: call to undeclared function 'ffi_prep_closure'

This is fixed by setting the appropriate flags as also already mentioned:

export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"

The next issue I ran into is not mentioned in the above comments:

ossl.c:311:14: error: 'ERR_get_error_line_data' is deprecated

In my case, trying to install ruby@2.5.8 which depends on openssl@1.1 is failing because Homebrew is locking me to openssl@3.0. I can't set this in my global flags because those are already being used for libffi, so we get a successful install by setting the flag locally:

rvm install 2.5 -- --with-openssl-dir=$(brew --prefix openssl@1.1)

@gitJoe42
Copy link

gitJoe42 commented Nov 4, 2023

For me it was necessary to follow this instructions: https://medium.com/@canerten/building-ruby-3-1-3-fails-with-openssl-1-0-2o-1-on-m1-apple-silicon-mac-with-brew-89d7e550420b

Then rvm install 3.2.2 worked like charm.

MacBook Air M2 macOs 14.0

By the way: This solved my original problem that after installing rails, rails wasn't found on my system. (Rails is not currently installed on this system. To get the latest version)

@gabeodess
Copy link

Okay, after running into this a number of times I've finally figured out my issues, so I'll document them here.

This is on a 2021 M1 MacBook Pro.

To @sometimescasey 's point, you should review your log file to determine specifically which issues you are facing.

My first error like some of the above comments was:

closure.c:264:14: error: call to undeclared function 'ffi_prep_closure'

This is fixed by setting the appropriate flags as also already mentioned:

export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"

The next issue I ran into is not mentioned in the above comments:

ossl.c:311:14: error: 'ERR_get_error_line_data' is deprecated

In my case, trying to install ruby@2.5.8 which depends on openssl@1.1 is failing because Homebrew is locking me to openssl@3.0. I can't set this in my global flags because those are already being used for libffi, so we get a successful install by setting the flag locally:

rvm install 2.5 -- --with-openssl-dir=$(brew --prefix openssl@1.1)

Following up on this, using --with-openssl-dir didn't seem to work for me when attempting to install ruby@2.6.6. Although I was supplying the directory to openssl@1.1, the error logs from compilation were still referencing openssl@3.

To solve this I linked the older version of openssl using homebrew and then was able to install without issue:

brew link --overwrite openssl@1.1
openssl version
# => OpenSSL 1.1.1w  11 Sep 2023
rvm install 2.6

@fdecono
Copy link

fdecono commented Dec 4, 2023

Mac M1 Monterey

rvm install 3.2.0 => Error running '__rvm_make -j8'

I solved the problem like this

  1. rvm remove 3.2.0
  2. rvm cleanup all
  3. rvm reinstall 3.2.0 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --disable-dtrace --disable-docs

THX!!!! Was having issues with 3.1.3 after updating to Sonoma and this fixed it (using 3.1.3 instead of 3.2.0)

@xnzMeow
Copy link

xnzMeow commented Jan 9, 2024

Mac M1 max sonoma
rvm install 3.2.0 => Error running '__rvm_make -j10'
I solved the problem like this

  1. rvm remove 3.1.3
  2. rvm cleanup all
  3. rvm reinstall 3.1.3 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --disable-dtrace --disable-docs

THX!!!! Was having issues with 3.1.3 after updating to Sonoma and this fixed it (using 3.1.3 instead of 3.2.0)

I am using sonoma this command solved my problem. THANK YOU : )

@felipefunes
Copy link

Mac M1 Monterey

rvm install 3.2.0 => Error running '__rvm_make -j8'

I solved the problem like this

rvm remove 3.2.0
rvm cleanup all
rvm reinstall 3.2.0 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --disable-dtrace --disable-docs

I'm using Mac M1 with Sonoma and this works for me installing Ruby 3.3.0 Thanks!

@elabayoub
Copy link

This one worked for me (Ventura 13.1) => OS cloned for another machine that's who i've force arch:

arch -x86_64 rvm install 3.3.0 --with-openssl-dir=/usr/local/opt/openssl@1.1

@ryankoch13
Copy link

Mac M1 Monterey

rvm install 3.2.0 => Error running '__rvm_make -j8'

I solved the problem like this

  1. rvm remove 3.2.0
  2. rvm cleanup all
  3. rvm reinstall 3.2.0 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --disable-dtrace --disable-docs

thank you so so so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests