Unable to install any ruby version through rvm on a Mac M1 Silicon Chip
Asked Answered
H

4

18

Example of Error response:

TTRAN-YK0WK9W9PM:virtual_terminal tuantran$ rvm install 2.7.6
ruby-2.7.6 - #removing src/ruby-2.7.6..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/12.3/arm64/ruby-2.7.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/[email protected]/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/tuantran/.rvm/rubies/ruby-2.7.6, this may take a while depending on your cpu(s)...
ruby-2.7.6 - #downloading ruby-2.7.6, this may take a while depending on your connection...
ruby-2.7.6 - #extracting ruby-2.7.6 to /Users/tuantran/.rvm/src/ruby-2.7.6.....
ruby-2.7.6 - #configuring.........................................................................
ruby-2.7.6 - #post-configuration.
ruby-2.7.6 - #compiling......................................................
Error running '__rvm_make -j10',
please read /Users/tuantran/.rvm/log/1658248808_ruby-2.7.6/make.log

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

Solution: https://github.com/rvm/rvm/issues/5153

  1. Right click Terminal from the Application/Utilities folder, Get Info, tick the "Open using Rosetta" box.
  2. Uninstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
rm -rf /opt/homebrew/*
sudo rm -rf /opt/homebrew
  1. Reinstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Restart terminal
  2. Check Homebrew is working fine: brew doctor
  3. Reinstall openssl: brew install openssl
  4. Install Ruby: rvm install 2.7 Or any version
Helpless answered 19/7, 2022 at 17:59 Comment(1)
github.com/rvm/rvm/issues/5153#issuecomment-1301062739 Worked for meNonconformance
W
8

The following worked for me ruby version 3.3.0 -

You can check the path of the ssl directory in your system with the command given below.

brew --prefix openssl@3

enter image description here

After that run the below command with the SSL directory path

rvm reinstall 3.3.0 --with-openssl-dir=your ssl directory path

rvm reinstall 3.3.0 --with-openssl-dir=/opt/homebrew/opt/openssl@3
Wash answered 10/1, 2024 at 17:29 Comment(2)
This worked perfectly and got me past the OpenSSL error.Concordance
Worked, after hours of searching. Thanks.Villa
N
2

The following worked for me - https://github.com/rvm/rvm/issues/5153#issuecomment-1301062739

brew install libffi
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
LDFLAGS="-L/opt/homebrew/opt/libffi/lib" CPPFLAGS="-I/opt/homebrew/opt/libffi/include" rvm install 2.5.1
Nonconformance answered 20/3, 2023 at 9:48 Comment(0)
J
1

I faced similar issue while installing 2.7.2. How I was able to resolve it was changing the current version of openssl.

First find out what is the current version of openssl

openssl version

ruby 2.7.2 is compatible with [email protected].

So first install it using brew

arch -arm64 brew install [email protected]

To switch to [email protected] open up editor

nano ~/.zshrc or nano ~/.bash  

Add these lines

export LDFLAGS="-L$(brew --prefix [email protected])/lib"
export CPPFLAGS="-I$(brew --prefix [email protected])/include"
export PKG_CONFIG_PATH="$(brew --prefix [email protected])/lib/pkgconfig"
export PATH="$(brew --prefix [email protected])/bin:$PATH"

Save and exit. Restart the terminal.

Confirm if the openssl version is now set to 1.1 or not.

Then finally

arch -arm64 rvm install 2.7.2
Jannelle answered 7/5, 2024 at 10:21 Comment(0)
E
-5

A simple uninstall and install of brew and rvm did the trick for me.

  • uninstall rvm
  • uninstall brew
  • make sure that in none of your dotfiles openssl libs are added to your path
  • update to the latest xcode command line tools
  • install brew
  • do not manually install openssl
  • install rvm
  • instal any ruby version you like

please do not install brew or start the terminal with rosetta, this will slow down massively more or less everything.

edit: it looks like this works only for ruby versions >= 2.7.2 ruby versions prior to 2.7.2 will have the same issue.

Ejaculation answered 15/11, 2022 at 9:26 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.