Skip to content

Instantly share code, notes, and snippets.

@msykiino
Last active August 29, 2015 13:58
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 msykiino/9987205 to your computer and use it in GitHub Desktop.
Save msykiino/9987205 to your computer and use it in GitHub Desktop.
Macにhomebrewでrbenvをインストールする
#!/bin/bash
#set -x
VER=2.1.1
trap 'echo -e "\nabort: signal trapped\n"; exit 1' 1 2 3 15
echo
echo "Starting..."
echo
brew update
brew upgrade
brew install openssl
brew install readline
brew install rbenv
brew install ruby-build
brew install rbenv-gemset
brew install rbenv-gem-rehash
brew list -l
test ! -f ~/.rbenvrc && echo 'eval "$(rbenv init -)"' >> ~/.rbenvrc
if [ ! -d "/usr/lib64" ]; then
sudo mkdir /usr/lib64
sudo chmod 2775 /usr/lib64
sudo chown root:admin /usr/lib64
fi
cat <<_EOT_
rbenv install -l
rbenv install $VER
rbenv global $VER
rbenv rehash
rbenv versions
rbenv version
_EOT_
echo
echo "Finished."
echo
echo "Do not forget to reload [ ~/.bashrc ]."
echo
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment