Created
May 13, 2016 17:35
-
-
Save ryanwarsaw/ef1e5235bc654b98028f37604bedba02 to your computer and use it in GitHub Desktop.
This file contains 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
# Install Command Line Tools | |
if ! type xcode-select >&- && xpath=$(xcode-select --print-path) && test -d "$xpath" && test -x "$xpath"; then | |
# Accept the Xcode license agreement | |
xcodebuild -license | |
# Run command line tool installation script | |
xcode-select --install | |
fi | |
# Install Homebrew (or update if installed) | |
if ! brew_location="$(type -p brew)" || [ -z "$brew_location" ]; then | |
# Run brew installation script | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Prepare installation for use | |
brew doctor | |
else | |
# Update brew to the latest version | |
brew update | |
# Run system health check and fix missing links | |
brew doctor | |
# Upgrade all installed brew packages to latest versions | |
brew upgrade | |
# Remove older versions of brew packages | |
brew cleanup | |
fi | |
# Install RVM (Ruby Version Manager) and Ruby | |
if ! rvm_location="$(type -p rvm)" || [ -z "$rvm_location" ]; then | |
# Run RVM installation script | |
curl -L https://get.rvm.io | bash -s stable --ruby | |
# Load RVM into active shell session | |
source ~/.rvm/scripts/rvm | |
# Install latest version of Ruby | |
rvm use ruby --install --default | |
else | |
# Update RVM to the latest version | |
rvm get stable | |
# Install latest version of Ruby | |
rvm use ruby --install --default | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment