Skip to content

Instantly share code, notes, and snippets.

@thedeerchild
Created August 15, 2013 00:11
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 thedeerchild/6237087 to your computer and use it in GitHub Desktop.
Save thedeerchild/6237087 to your computer and use it in GitHub Desktop.
Install Rails on ZURB machines.
#!/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