Skip to content

Instantly share code, notes, and snippets.

@chriskk
Last active December 30, 2015 02:29
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 chriskk/7762702 to your computer and use it in GitHub Desktop.
Save chriskk/7762702 to your computer and use it in GitHub Desktop.
OS X 10.9 Mavericks Dev Environment

OS X 10.9 Mavericks Dev Environment

2013-12-02

XCode, Command Line Tools, and XQuartz

Install XCode (5.0.2) from the App Store

Install Command Line Tools (git is included)

Before installing Ruby, you’ll need to prepare your computer by installing Apple’s Xcode Command Line Tools.

The Xcode Command Line Tools provide a C language compiler needed to install Ruby. For many Rails projects, you will need the C language compiler to install gems that use native extensions.

Mac OS X Mavericks will alert you when you enter a command in the terminal that requires Xcode Command Line Tools. For example, you can enter gcc, git, or make.

Try it. Enter:

$ gcc

Reference:

Setup Local Dot Files

Set aliases, color scheme, and paths.

Clone chriskk Dot Files into ~/

$ git clone https://github.com/chriskk/dotfiles.git

Local environment variables are set within localrc, which is ignored by git. Add local paths such as /usr/local and any aliases to localrc.

# Create a locarlrc file
$ cd dotfiles
dotfiles $ vim localrc

Run the installation script, which will symlink the dot files. Existing symlinked dot files are not touched.

dotfiles $ rake install

Pull in latest vim plugins

dotfiles $ git submodule update --init

Homebrew

Use Homebrew to install and manage: gcc-4.2, MySQL, Postgres, ImageMagick, and other packges.

Install Homebrew

$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ brew doctor
$ brew update

Install Git 1.8.5

$ brew install git
# Open up a new terminal
$ git --version
git version 1.8.5

Install GCC 4.2

Because Mavericks, like Mountaion Lion, doesn’t come with GCC 4.2, it needs to be installed and linked to the correct place. Some packages require it so it’s best to install it now – brew install apple-gcc42 and sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

$ brew install apple-gcc42

Reference:

Install MySQL 5.6.x

$ brew install mysql

Set MySQL server to start on startup

$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/mysql/5.6.14/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Secure it and give you the option of removing the test databases and anonymous user created by default.

$ /usr/local/opt/mysql51/bin/mysql_secure_installation

To start and stop mysql using System Preferences, download the latest version of MySQL from the official site. Open up the .dmg file. Drag and drop MySQL.prefPane onto System Preferences. Follow the directions in the Stack Overflow thread. Basically you'll need to create a symbolic link and set the data directory to a specific user/group.

$ mkdir -p /usr/local/mysql
$ cd /usr/local/mysql
$ ln -s $(brew --prefix mysql)/* .
$ chown -R _mysql:wheel /usr/local/var/mysql

For a nice GUI download and use Sequel Pro.

Install PostgreSQL

$ brew install postgresql

A Mac OS X System Preferences pane for controlling the PostgreSQL Database Server.

https://github.com/mckenfra/postgresql-mac-preferences

Install ImageMagick

$ brew install imagemagick
$ identify -version
ersion: ImageMagick 6.8.7-0 2013-10-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib freetype jng jpeg ltdl png png xml zlib

Install RVM: Ruby Version Manager

Install RVM with a Ruby (latest will be Ruby 2, but you may specify):

$ \curl -L https://get.rvm.io | bash -s stable --ruby

To start using RVM you need to run source /Users/chriskk/.rvm/scripts/rvm. After Ruby 2 is installed, install the latest Ruby 1.9.3:

$ rvm install 1.9.3

If you wish to use RVM in an interactive fashion in other shells then place the following line at the end of your shell's loading files (.bashrc or .bash_profile for bash and .zshenv for zsh), after all PATH/variable settings:

$ vim ~/.localrc
# Loads RVM into a shell session
[[ -s "/Users/chriskk/.rvm/scripts/rvm" ]] && source "/Users/chriskk/.rvm/scripts/rvm"

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment