Last active
March 17, 2018 05:57
-
-
Save yoshuki/7615220 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
RBENV_HOME="$HOME/.rbenv" | |
if [ "$1" = 'init' ]; then | |
git clone https://github.com/rbenv/rbenv.git $RBENV_HOME | |
mkdir $RBENV_HOME/plugins | |
if [ $? -eq 0 ]; then | |
cd $RBENV_HOME/plugins | |
git clone https://github.com/rbenv/ruby-build.git | |
fi | |
cd $HOME | |
echo '==================================================' | |
cat <<'EOT' | |
echo 'export RBENV_HOME="${HOME}/.rbenv"' >> $HOME/.zshrc | |
echo 'export PATH="${RBENV_HOME}/bin:${PATH}"' >> $HOME/.zshrc | |
echo 'eval "$(rbenv init -)"' >> $HOME/.zshrc | |
EOT | |
exit | |
fi | |
for dir in '' '/plugins/ruby-build' | |
do | |
cd $RBENV_HOME$dir | |
git pull origin master | |
cd $HOME | |
done | |
echo '==================================================' | |
rbenv install -l | |
echo '--------------------------------------------------' | |
rbenv versions | |
echo '==================================================' | |
cat <<EOT | |
rbenv install [NEW] --verbose | |
rbenv global [NEW] | |
gem install bundler | |
rbenv uninstall [OLD] | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment