Skip to content

Instantly share code, notes, and snippets.

@ninjabiscuit
Created May 28, 2012 09:20
Show Gist options
  • Save ninjabiscuit/2818107 to your computer and use it in GitHub Desktop.
Save ninjabiscuit/2818107 to your computer and use it in GitHub Desktop.
Install all the things

###To generate SSH keys run:

ssh-keygen

(keep pressing enter till the notices go away)

Then you will have a private key. Next run

cat ~/.ssh/id_rsa.pub

Email the results to stuart and ask him to add it to github so we can add you to the MXM dev account

###Installing Xcode

Whether you’re upgrading Snow Leopard or you have a fresh install of Lion ready to go, the first thing that you’ll need to do is install Xcode. It’s free and available at the Mac App Store.

One thing of note, unlike other applications from the Mac App Store, downloading it doesn’t mean installing it. Once downloaded you’ll have to run the Install Xcode application to get it installed.

###Installing Homebrew

Homebrew is a package manager that allows you to install all sorts of Open Source goodies on your Mac with a simple command. If you’re upgrading from Snow Leopard and you already had Homebrew installed, my experience has been that you don’t need to do anything different.

If you’re on a fresh install though, you can install Homebrew with the following command.

ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

Follow the instructions provided by Homebrew to complete the installation.

###Installing Git

Pretty much every Rails hacker out there uses Git, so let’s grab that using Homebrew. Again, if you already had Git installed using Homebrew on Snow Leopard, you won’t need to do anything new here.

brew install git

###Optional Install: wget and oh-my-zsh

The following is completely optional, but I recommend them. By default, OS X uses the bash shell when interacting with the terminal, but that’s not the only shell available. I prefer zsh myself and for my install process, I use Robby Russell’s oh-my-zsh. It’s easiest to install oh-my-zsh with wget, so we’ll install that first. If you’ve upgraded, you won’t need to do anything new for zsh to continue working.

brew install wget

Once wget is installed, installing oh-my-zsh is easy.

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh 

Follow any prompt by the install script to complete installation. Closing and re-opening your terminal should launch zsh from now on. To check run this command:

ps -p $$

You should see zsh instead of bash. If you don’t, you can switch your shell manually be running the change shell command.

chsh -s /bin/zsh

###Installing RVM

Although OS X comes with a version of Ruby, it’s somewhat out of date. We can work around the issue by installing RVM.

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

Follow any prompts from the RVM install process to complete the installation. One of the final install steps for RVM is automatically loading into a shell session. You should follow the latest install step but for my copy and paste purposes those are:

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.

Close the shell and restart it in order to have RVM loaded.

NOTE: When I upgraded, I was having an issue with Passenger, and I thought that my RVM install might be the culprit. So I removed RVM completely and simple re-installed it according the these instructions.

If you want to remove RVM complete run the following command:

rvm implode

###Install: Ruby 1.9.3

Use Ruby 1.9.3 for any new Rails 3 applications. Installing is simple:

rvm install 1.9.3
rvm --default use 1.9.3

###Install Node

brew install node

###Install NPM (node package manager)

curl http://npmjs.org/install.sh | sh

###Optional install of NVM (node version manager)

Download NVM from github

git clone git://github.com/creationix/nvm.git ~/.nvm

Paste this into your .zshrc file

# Node / nvm
if [ -f "$HOME/nvm/nvm.sh" ]; then
  source "$HOME/nvm/nvm.sh"
fi

First sync nvm so it can 'check' all Node.js versions:

nvm sync

For further information see the docs on github

###Installing Database Servers

Although SQLite works for most smaller projects, MySQL and PostgreSQL are usually needed for larger projects. Installing them is easy with Homebrew. If you’re upgrading from Snow Leopard, you don’t need to do anything different with your database servers.

###Installing MySQL

brew install mysql

Make sure that you follow the instructions at the end to complete the installation and setup. You can review the post install instructions at any time by using the Homebrew info command.

brew info mysql

Sequel Pro is a handy little GUI for MySQL

http://www.sequelpro.com/ 

###Installing PostgreSQL

brew install postgres

Again, make sure that you follow the instructions at the end to complete the installation and setup. As with MySQL, you can review the post install instructions at any time by using the Homebrew info command.

brew info postgres

###Installing Redis

brew install redis

Or if that doesn't work download, extract and compile Redis with:

wget http://redis.googlecode.com/files/redis-2.4.14.tar.gz
tar xzf redis-2.4.14.tar.gz
cd redis-2.4.14
make

###Installing Base Gems

One of the cool things about RVM is that you can create gemsets. These allow you to compartmentalize your Ruby gem installs. By default, RVM creates one global gemset that others will inherit from. In this gemset, I usually apply some base gems that I want across all projects. A full treatise on gemsets is beyond the scope of this guide so I urge you to read the RVM documentation for more information.

gem install bundler
gem install capistrano
gem install heroku
gem install conan /*for deploying all the things*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment