Skip to content

Instantly share code, notes, and snippets.

@christiannelson
Last active Sep 26, 2016
Embed
What would you like to do?
Opinionated instructions for setting up a laptop for development at Carbon Five. Not intended to be run wholesale; read, interpret, tweak (maybe), then run piece by piece.
# Opinionated instructions for setting up a laptop for development at Carbon Five.
# Not intended to be run wholesale; read, interpret, tweak (maybe), then run piece by piece.
#
# Tested against Yosemite 10.10.
#--------------------------------------
# Install Homebrew.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# You'll have to provide your password during installation. You should say 'install' when
# prompted to install the xcode command line tools.
# Note: Depending on your shell, the following instructions may need to be tweaked. These
# steps assume zsh with oh-my-zsh. Adjust accoridngly for your preferred shell.
# Make sure brew is happy.
brew doctor
# Make sure /usr/local/bin is early in your $PATH (should be by default on Yosemite).
echo $PATH
#--------------------------------------
# Install oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh).
curl -L http://install.ohmyz.sh | sh
# Enable a small set of common plugins.
sed -i '' 's/plugins=.*/plugins=(brew git rbenv gem rake bundler node npm heroku postgres redis-cli)/' ~/.zshrc
#--------------------------------------
# Install general development tools.
brew install openssl git zsh wrk siege ngrok wget phantomjs imagemagick optipng heroku-toolbelt
which git # Double check: /usr/local/bin/git
#--------------------------------------
# Install development packages for ruby.
cat > ~/.gemrc <<BLOCK
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
BLOCK
brew install ruby-build rbenv rbenv-gem-rehash rbenv-default-gems
cat >> ~/.zshrc <<BLOCK
# RBENV
export PATH=$HOME/.rbenv/bin:$PATH
eval "\$(rbenv init -)"
BLOCK
source ~/.zshenv
# Default gems are automatically installed when a new ruby is installed.
cat > ~/.rbenv/default-gems <<BLOCK
hub
lunchy
gemcutter
wirble
awesome_print
bundler
mailcatcher
BLOCK
# Install the latest ruby and make it the default (2.1.4 is latest at the time of writing).
rbenv install 2.1.4
rbenv global 2.1.4
ruby -v # Double check: 2.1.4
#--------------------------------------
# Install development packages for node.js.
brew install node
#--------------------------------------
# Install typical databases and services.
brew install postgresql redis mongodb
# Follow the instuctions for starting these services when you login (e.g. ln -s ..., launchctl ...).
# It's nice to have common services up and running so that you don't have to start/stop them as you
# switch between projects.
# Create a default superuser for postgresql as a convention. Makes spinning up new projects easier
# by eliminating an extra step.
createuser -s postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment