Reputation: 7459
I always get bellow error on my M1 mac while rvm install 2.6.7
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/[email protected]/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.
Upvotes: 12
Views: 8146
Reputation: 1152
As shown in this Issue on Github, the issue is due to the version of openssl that is used. I had to download an old version of openssl and bind it to the ruby installation.
You can download the required version here.
Then run these commands:
$> tar -xzf openssl-OpenSSL_1_0_2u.tar.gz
$> cd openssl-1.0.2u
$> ./Configure darwin64-x86_64-cc --prefix=/usr/local/opt/[email protected]
$> make
$> make test
$> sudo make install
$> rvm install 2.6.7 --with-openssl-dir=/usr/local/opt/[email protected]
Update the version you want to use for ruby in the last command.
You will maybe need to run:
$> rvm osx-ssl-certs update all
Upvotes: 0
Reputation: 12120
Provided you have homebrew installed on an M1, these two steps seem to solve the issue.
brew install libffi
LDFLAGS="-L/opt/homebrew/opt/libffi/lib" CPPFLAGS="-I/opt/homebrew/opt/libffi/include" rvm install 2.7.7
Upvotes: 1
Reputation: 107
Please check this it works for me.
brew install openssl
rvm install 2.6.7 --with-openssl-dir=/usr/local/opt/openssl
Upvotes: 2
Reputation: 19
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 [email protected]. If it still is error. Maybe see this blog enter link description here, which doesn't use arm one.
Upvotes: 2
Reputation: 2793
I had the same issue in RVM, following solution worked for me.
CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.6.0
Upvotes: 6
Reputation: 316
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?
Upvotes: 11