Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to OpenSSL 1.1.1i (solves issues on Apple Silicon chips 🚀😹) #1502

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

deepj
Copy link
Contributor

@deepj deepj commented Dec 10, 2020

OpenSSL 1.1.1i is possible to compile without problems on new Apple Silicon chips.

This solves #1496, #1493, #1456. There is no need to apply this patch #1456 (comment) as well.

Homebrew offers already some prelimited ARM bottles (Homebrew/brew#9488). One of them is readline. So I just brew install readline and compiled readline for Apple Silicon was installed.

I was able to compile ruby 2.7.2 on Apple Silicon using ruby-build without any issues as before on Intel Macs.

$ ruby-build 2.7.2 ~/.rubies/ruby-2.7.2-arm
Downloading openssl-1.1.1i.tar.gz...
-> https://www.openssl.org/source/openssl-1.1.1i.tar.gz
Installing openssl-1.1.1i...
Installed openssl-1.1.1i to ~/deepj/.rubies/ruby-2.7.2-arm

Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...
ruby-build: using readline from homebrew
Installed ruby-2.7.2 to ~/.rubies/ruby-2.7.2-arm

... magic switch to Ruby 2.7.2 for Apple Silicon using chruby

$ ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
$ ruby -e 'puts "Hello from Apple Silicon Mac!"'
Hello from Apple Silicon Mac!

@deepj deepj changed the title Upgrade to OpenSSL 1.1.1i Upgrade to OpenSSL 1.1.1i (solves issues on Apple Silicon chips 🚀😹) Dec 10, 2020
@hsbt
Copy link
Member

hsbt commented Dec 10, 2020

@deepj Thanks for tracking OpenSSL. I will merge this after passing CI.

@hsbt hsbt merged commit bad7a7c into rbenv:master Dec 10, 2020
@deepj
Copy link
Contributor Author

deepj commented Dec 10, 2020

@hsbt Thanks! I'd like to ask you if you could release new ruby-build with this change. If you can, of course. I hope this helps the other Ruby users on the new Macs with Apple Silicon chip.

@hsbt
Copy link
Member

hsbt commented Dec 10, 2020

Done https://github.com/rbenv/ruby-build/releases/tag/v20201210

@tnr2323

This comment has been minimized.

@elviajero971
Copy link

elviajero971 commented Jan 25, 2021

Hello there. I'm having some issues regarding the installation of ruby 2.6.6 using rbenv on a macbook air M1 Big Sur. I tried several tutorial but nothing seems to work... Any tips from you guys ?
There is the different tutorials followed:

https://www.codegrepper.com/code-examples/delphi/ruby+install+mac

https://gorails.com/setup/osx/11.0-big-sur

https://brandur.org/fragments/ruby-3-on-m1?fbclid=IwAR0hTYdiw_GOtGbWL4kRs5f2zcnL6NhdQh99DGw1fZMoyUr9pvvGTIYwLyM

I always got the same error:

`
Downloading openssl-1.1.1i.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
Installing openssl-1.1.1i...
Installed openssl-1.1.1i to /Users/lucas-illiano/.rubies/ruby-2.6.6-arm

Downloading ruby-2.6.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.bz2
Installing ruby-2.6.6...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.1 using ruby-build 20210119)

Inspect or clean up the working tree at /var/folders/pv/4_6kwrq57y3567vcdv1d2j780000gn/T/ruby-build.20210125200711.41511.yqtTCv
Results logged to /var/folders/pv/4_6kwrq57y3567vcdv1d2j780000gn/T/ruby-build.20210125200711.41511.log

Last 10 log lines:
return document->nodes.top - document->nodes.start;
~~~~~~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
../.././ext/psych/yaml/api.c:1321:32: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return document->nodes.top - document->nodes.start;
~~~~~~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
linking shared-object zlib.bundle
1 warning generated.
linking shared-object psych.bundle
make: *** [build-ext] Error 2
`

Thanks by advance for your answers. :)

Last UPDATE: All issues fixed with the command
RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.6

@hsbt
Copy link
Member

hsbt commented Jan 25, 2021

FYI: Ruby 2.6 didn't support with Apple M1 chip officially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants