rvm install 2.6.7 always failed on Apple M1 mac

Viewed 4183

I always get bellow error on my M1 mac while rvm install 2.6.7

enter image description here

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

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

Yes, this is a known issue upstream: https://bugs.ruby-lang.org/issues/17777 ruby-build is also tracking this issue: https://github.com/rbenv/ruby-build/issues/1489

The work around is to run the following code, and install ruby 2.6.7 again:

$ export warnflags=-Wno-error=implicit-function-declaration
$ rbenv install 2.6.7

-or-

$ CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7

Looks like this can also impact gem installation with native extensions (mysql2 is one of those):

gem install <GEMNAME> -- --with-cflags="-Wno-error=implicit-function-declaration"

Referenced: Error installing ruby 2.6.7 on mac os - how to resolve?

I had the same issue in RVM, following solution worked for me.

CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.6.0

I faced the same problem, the easiest way is to install 2.6.9 later version, everything will be ok.

If you really need older version ruby, you can try to use openssl@1.0. If it still is error. Maybe see this blog enter link description here, which doesn't use arm one.

Please check this it works for me.

brew install openssl
rvm install 2.6.7 --with-openssl-dir=/usr/local/opt/openssl
Related