Skip to content

Instantly share code, notes, and snippets.

@thehashrocket
Last active January 17, 2019 15:01
Show Gist options
  • Save thehashrocket/67edb6fa75d61bd851e5654372822739 to your computer and use it in GitHub Desktop.
Save thehashrocket/67edb6fa75d61bd851e5654372822739 to your computer and use it in GitHub Desktop.
setup-rbenv.sh
#!/bin/bash
set -ex
brew update
brew install rbenv ruby-build
rbenv install 2.5.3
echo "export GEM_HOME=$HOME/gems" >> ~/.zshrc
echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.zshrc
source ~/.zshrc
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
rbenv global 2.5.3
gem install bundler
rbenv rehash
ruby -v
if ! type rbenv | grep function; then
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
fi
set +x
echo "Done! Close and reopen your terminal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment