Skip to content

Instantly share code, notes, and snippets.

@capsulecorplab
Last active January 6, 2021 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capsulecorplab/aa4c5a8167509b94ac43405f99bc9ffd to your computer and use it in GitHub Desktop.
Save capsulecorplab/aa4c5a8167509b94ac43405f99bc9ffd to your computer and use it in GitHub Desktop.
install script for rbenv
#!/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