Created
August 15, 2013 00:11
-
-
Save thedeerchild/6237087 to your computer and use it in GitHub Desktop.
Install Rails on ZURB machines.
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
#!/bin/bash | |
# Go home | |
cd | |
# Install Homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
# Install git | |
brew install git | |
# Install Rbenv | |
brew install rbenv | |
brew install ruby-build | |
# Add shims and autocomplete to profile | |
LINE_TO_ADD='if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' | |
if ! grep -qsFx "$LINE_TO_ADD" ~/.profile ~/.bash_profile ; then | |
profile=~/.profile | |
[ -w "$profile" ] || profile=~/.bash_profile | |
printf "%s\n" "$LINE_TO_ADD" >> "$profile" | |
source "$profile" | |
fi | |
# Reload profile | |
rbenv rehash | |
# Install newest ruby and set it as default | |
rbenv install 2.0.0-p247 | |
rbenv global 2.0.0-p247 | |
# Install Bundler and Rails | |
gem install bundler --no-rdoc --no-ri && gem install railties --no-rdoc --no-ri | |
# Rebuild native extensions | |
rbenv rehash | |
# Confirm successful installation | |
rails -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment