-1

I need to change my ruby version to 2.6.5 to get a dev environment running for an existing app, however I get a strange error when I try to install it.

Macbook pro

M2

Ventura 13.1

ruby -v: 3.0.0

node -v: 16.12.0

I have RVM installed, when I enter in the terminal to switch ruby versions this is what happens:

rvm use 2.6.5
Required ruby-2.6.5 is not installed.
To install do: 'rvm install "ruby-2.6.5"'

Next I try to install 2.6.5

rvm install 2.6.5
ruby-2.6.5 - #removing src/ruby-2.6.5 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/13.1/arm64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Updating certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem'
Requirements installation successful.
Installing Ruby from source to: /Users/placeholder/.rvm/rubies/ruby-2.6.5, this may take a while depending on your cpu(s)...
ruby-2.6.5 - #downloading ruby-2.6.5, this may take a while depending on your connection...
ruby-2.6.5 - #extracting ruby-2.6.5 to /Users/placeholder/.rvm/src/ruby-2.6.5 - please wait
ruby-2.6.5 - #configuring - please wait
ruby-2.6.5 - #post-configuration - please wait
ruby-2.6.5 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/placeholder/.rvm/log/1671569360_ruby-2.6.5/make.log

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

The make.log file is just a massive code snippet of ruby trying to make the change.
Any ideas on how I can fix this?

Milo P
  • 1,377
  • 2
  • 31
  • 40

3 Answers3

1

As per advice from anothermh, uninstalled rbenv and brew versions of Ruby

Uninstallation

brew uninstall ruby for removing brew version

Use accepted answer on this SO article for removing rbenv

Install Ruby via RVM

Install RVM as per instructions || as per this

rvm install (ruby version)

rvm --default use (ruby version)

can use rvm list to see available ruby versions.

0

Using rvm:

Install the ruby version:

rvm install 2.6.5

Set and use default 2.6.5:

rvm use 2.6.5 --default

Julian
  • 138
  • 1
  • 10
0

I ended up uninstalling RVM and switched to rbenv, after a lot of trouble shooting running this command got the desired Ruby version 2.6.5 to install. So to anyone else with the same Macbook pro with the M2 chip that needs to work on older versions of ruby this is the command I used.

RUBY_CFLAGS="-w" rbenv install 2.6.5 

Also if anyone else is having trouble and this doesnt work for you, I found this answer by going through this github discussion, there's plenty of other workarounds that have worked for other various scenarios.

Installing Ruby on Macbook pro M1/M2 chips from github