0

Installing Ruby 2.5 on Mac M1

 1 year ago
source link: https://gist.github.com/MarkBennett/b123f72c5d15703f7cceb75b6a0e365a
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Installing Ruby 2.5 on Mac M1 · GitHub

Instantly share code, notes, and snippets.

Installing Ruby 2.5 on Mac M1

I was able to get Ruby 2.5.1 building on M1 by following two of the steps in that GH issue...

rbenv/ruby-build#1691 (comment) rbenv/ruby-build#1691 (comment)

I installed readline and openssl with standard brew install.

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

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK