if [[ ! -d "$HOME/.rbenv" ]]; then fancy_echo "Installing rbenv, to change Ruby versions ..." git clone git://github.com/sstephenson/rbenv.git ~/.rbenv if ! grep -qs "rbenv init" ~/.zshrc; then printf 'export PATH="$HOME/.rbenv/bin:$PATH"\n' >> ~/.zshrc printf 'eval "$(rbenv init - --no-rehash)"\n' >> ~/.zshrc fi export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" fi if [[ ! -d "$HOME/.rbenv/plugins/rbenv-gem-rehash" ]]; then fancy_echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..." git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash fi if [[ ! -d "$HOME/.rbenv/plugins/ruby-build" ]]; then fancy_echo "Installing ruby-build, to install Rubies ..." git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build fi