Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 715
Tony Tran Avatar asked Nov 22 '25 22:11

Tony Tran


2 Answers

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
like image 125
Rakesh Bakoriya Avatar answered Nov 26 '25 15:11

Rakesh Bakoriya


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
like image 36
Surbhit Rao Avatar answered Nov 26 '25 14:11

Surbhit Rao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!