Last active
February 1, 2021 16:46
-
-
Save jorgegorka/fe2a8271122ad357180988bf34a1263b to your computer and use it in GitHub Desktop.
Install ruby via rbenv in Mac os big sur
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 openssl readline | |
# edit .zshrc | |
# Setup Compiler paths for readline and openssl | |
local READLINE_PATH=$(brew --prefix readline) | |
local OPENSSL_PATH=$(brew --prefix openssl) | |
export LDFLAGS="-L$READLINE_PATH/lib -L$OPENSSL_PATH/lib" | |
export CPPFLAGS="-I$READLINE_PATH/include -I$OPENSSL_PATH/include" | |
export PKG_CONFIG_PATH="$READLINE_PATH/lib/pkgconfig:$OPENSSL_PATH/lib/pkgconfig" | |
# Use the OpenSSL from Homebrew instead of ruby-build | |
# Note: the Homebrew version gets updated, the ruby-build version doesn't | |
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$OPENSSL_PATH" | |
# Place openssl@1.1 at the beginning of your PATH (preempt system libs) | |
export PATH=$OPENSSL_PATH/bin:$PATH | |
# Load rbenv | |
eval "$(rbenv init -)" | |
# Extract the latest version of Ruby so you can do this: | |
# rbenv install $LATEST_RUBY_VERSION | |
export LATEST_RUBY_VERSION=$(rbenv install -l | grep -v - | tail -1) | |
rm -rf ~/.gem | |
rbenv install 2.7.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment