Last active
January 6, 2021 01:48
-
-
Save capsulecorplab/aa4c5a8167509b94ac43405f99bc9ffd to your computer and use it in GitHub Desktop.
install script for rbenv
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
#!/usr/bin/env bash | |
################################################################################ | |
# rbenv w/ ruby-build install script. See https://github.com/rbenv/rbenv | |
# Install rbenv using, | |
# $ ./install-rbenv.sh | |
# | |
# Then install & set your preferred global version of Ruby using, | |
# $ rbenv install 2.6.5 -v | |
# $ rbenv global 2.6.5 | |
################################################################################ | |
if [ ! -r ~/.rbenv/ ]; then | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
cd ~/.rbenv && src/configure && make -C src | |
echo ' | |
# rbenv | |
export RBENV_ROOT="$HOME/.rbenv" | |
export PATH="$RBENV_ROOT/bin:$PATH" | |
if command -v rbenv 1>/dev/null 2>&1; then | |
eval "$(rbenv init -)" | |
fi' >> ~/.bashrc | |
source ~/.bashrc | |
exec "$SHELL" | |
fi | |
if [ ! -r ~/.rbenv/plugins ]; then | |
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment