Forked from MarkBennett/installing-ruby-2.5.1-on-m1.md
Created
April 19, 2022 02:52
-
-
Save Javieratapiab/d10b10b76516c5667073d3ae1055c0ef to your computer and use it in GitHub Desktop.
Revisions
-
MarkBennett created this gist
Mar 31, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ I was able to get Ruby 2.5.1 building on M1 by following two of the steps in that GH issue... https://github.com/rbenv/ruby-build/issues/1691#issuecomment-756272951 https://github.com/rbenv/ruby-build/issues/1691#issuecomment-772224551 I installed `readline` and `openssl` with standard `brew install`. ```bash brew install readline brew install openssl ``` Then I set this in my `~/.zshrc`.. ``` # 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="/opt/homebrew/opt/[email protected]/bin:$PATH" export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib" export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/[email protected]/lib/pkgconfig" export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/[email protected]" ``` Then I ran this command: ``` RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5 ```