These instructions are for Mac OSX 10.11 El Capitan. Following these instructions will prepare your workstation for developing in Ruby on Rails.
Mac OS X 10.11 El Capitan installation steps
#====================================================================================
# ** many commands require sudo but many do not
# ** this installation documentation is meant to describe a user level install
# ** where sudo is needed it is explicitly referenced
# ** pay attention to not add sudo where it is NOT listed
# ** it will affect the permissions negatively
#====================================================================================
# download El Capitan via App store
# do not install it
#
# Prepare USB drive
# - Open Disk Utility, and select the newly attached external drive
# - Choose the “Partition” tab, select “1 Partition” from the Partition Layout menu,
# then click “Options” and choose “GUID Partition Table” then “OK”
# - Choose “Apply”
# Create installer from install app downloaded from App store
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/OSXMAV --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
# Reboot from USB drive.
# When completed reboot and hold down the option key
# prepare mac for installations and configuration
# changes have been made to 10.10, that require
# modification in order to configure the way we want
# make the ~/Library directory visible so we can move bbedit customizations into it
chflags nohidden ~/Library/
# make directories for our projects
mkdir -p ~/Sites/shared/
# install xcode - needed for compilers and command line tools
# **this requires an apple developer account
# use the App Store app
xcode-select --install
# install homebrew - http://brew.sh/
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# check brew config
brew doctor
# update brew
brew update
# install packages
brew tap homebrew/dupes
brew tap homebrew/versions
brew install wget
brew install git git-extras bash-completion ghostscript imagemagick redis mongodb
# install these for compatibility with older versions of ruby < 2
brew install autoconf automake apple-gcc42
# capybara support
# without this the capybara gem fails to compile
brew install qt55
brew link --force qt55
# configure git
git config --global color.ui true
git config --global core.editor bbedit
git config --global color.branch auto
git config --global color.diff auto
git config --global color.status auto
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
# create new github account for user @ http://github.com
# or add key to existing github account
# create keys for new computer / user
ssh-keygen -t rsa -C "<your_email_username>@yourdomain.com"
pbcopy < ~/.ssh/id_rsa.pub
# copy keys user account @ http://github.com
# https://help.github.com/articles/generating-ssh-keys
# install mysql
brew install mysql
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start
# make mysql start automatically (optional)
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.6.12/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# if you want to set mysql root password (optional)
mysqladmin -u root password NEWPASSWORD
# install postgres
brew install postgresql
brew install memcached
# install hub
brew install hub
brew install coreutils
# install service startup via brew
brew tap homebrew/services
# install RVM and rubies
brew install gnupg gnupg2
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -L https://get.rvm.io | bash -s stable --ruby
# !! RELOAD terminal
#
# install rubies
rvm install 2.1.9
rvm install 2.2.5
# use this ruby as default and create gemset
rvm use 2.1.9@efault --create --default
###################
# create and edit .bash_profile for your environment
# !!
# copy everything from the line that starts with cat
# and ends with ENDOFMESSAGE
#
# paste it into your terminal and hit enter
# that will effectively create your bash profile
#
###################
cat > ~/.bash_profile <<-ENDOFMESSAGE
#############################################
# GIT completions & highlighted prompt
#############################################
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
GIT_PS1_SHOWDIRTYSTATE=true
PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[36m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
#############################################
# Bash ls colors
#############################################
export CLICOLOR=1
export LSCOLORS=DxGxcxdxCxegedabagacad
#############################################
# alias
#############################################
alias ll='ls -l'
alias la='ls -la'
########
## git
alias g='git status'
alias gg='git log'
alias gst='git status'
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gce="git commit --amend" # fix last commit message
alias gco='git checkout'
alias gd='git diff | bbedit'
alias gdm='git diff master'
alias gl='git pull'
alias gp='git push'
#############################################
# update path for mysql
#############################################
export PATH=$PATH:/usr/local/mysql/bin:/usr/local/share/npm/bin
export PATH=$PATH:$HOME/.rvm/gems/ruby-2.1.1/bin:$HOME/.rvm/gems/ruby-2.1.1@sysdefault/bin:$HOME/.rvm/rubies/ruby-2.1.1/bin:$HOME/.rvm/bin
#############################################
# RVM - for managing versions of ruby
#############################################
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
ENDOFMESSAGE
###########
# prevent gems from installing docs
echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
# install gems
gem install bundler
gem install mysql2
gem install pg
# Install NODE
# install NVM
# brew install nvm
# source $(brew --prefix nvm)/nvm.sh
# echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
# add lines to .bash_profile to load on new shell window
echo "export NVM_DIR=~/.nvm; source ~/.nvm/nvm.sh" >> ~/.bash_profile
# install stable version of node
nvm install stable
# set default node version
nvm alias default stable
# update npm
npm install -g npm@latest
# install node packages
npm install -g bower redis mysql grunt gulp sails yo
# additional installs
## ffmpeg
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 --with-openh264
## firebase tools
npm install -g firebase-tools