I was able to get Ruby 2.5.1 building on M1 by following two of the steps in that GH issue...
openssl with standard
brew install readline brew install openssl
Then I set this in my
# Homebrew export PATH=/opt/homebrew/bin:$PATH export PATH="/opt/homebrew/sbin:$PATH" # rbenv export RBENV_ROOT=/opt/homebrew/opt/rbenv export PATH=$RBENV_ROOT/bin:$PATH eval "$(rbenv init -)" # openssl export PATH="/email@example.com/bin:$PATH" export LDFLAGS="-Lfirstname.lastname@example.org/lib" export CPPFLAGS="-Iemail@example.com/include" export PKG_CONFIG_PATH="/firstname.lastname@example.org/lib/pkgconfig" export RUBY_CONFIGURE_OPTS="--email@example.com"
Then I ran this command:
RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5
I haven't been able to test this yet, but @samik3k has reported that this no longer works, but that the following command does.
RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC rbenv install 2.5.8
Please reply and let me know if this works for you and I'll update the steps above as I don't have Ruby setup on my M1 Mac right now.