Created
November 16, 2021 11:18
-
-
Save simonc/e9eb1f9bf5c7193f06be6a4633c59404 to your computer and use it in GitHub Desktop.
Installing an old Ruby on an M1 mac
This file contains 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 characters
brew install automake bison openssl readline libyaml gdbm libffi [email protected] shared-mime-info | |
brew tap raggi/ale | |
brew install openssl-osx-ca | |
brew services start openssl-osx-ca | |
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_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC | |
export optflags="-Wno-error=implicit-function-declaration" | |
mkdir /tmp/ruby-2.6.6 | |
cd /tmp/ruby-2.6.6 | |
curl https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.xz -o ruby-2.6.6.tar.xz | |
tar xfz ruby-2.6.6.tar.xz | |
cd ruby-2.6.6 | |
./configure \ | |
--prefix=$HOME/.rubies/ruby-2.6.6 \ # Change this to change the final install location | |
--build aarch64-apple-darwin20 \ | |
--with-opt-dir=$(brew --prefix [email protected]):$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm):$(brew --prefix libffi) | |
make -j2 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for making this. I am hoping it will help with some stupid cocoapod shit I am dealing with.
Unfortunately, i have never built ruby like this. I cant seem to get the
make -j2
command to work.