Last Updated: March 16, 2016
· tadejm

OS X Mavericks – From a clean install to working Ruby on Rails environment

Preparing for a clean installation

Although Apple provides a pretty nifty and reliable way of upgrading the operating system, I decided to do some Autumn cleaning, wipe my SSD and start anew.

Although I had the TimeMachine backup, I've stored all important stuff on an external USB disk, hence I won't be restoring from TimeMachine backup later on.

Installing OS X Mavericks

So in order to proceed with a clean install I bought an USB stick (8GB is enough) and used DiskMaker X to download and create a bootable USB disk.

I've created a new partition and formatted it as Journaled Case-sensitive.

The installation itself takes about 20 minutes (depended on SSD and USB drive/stick speed).

Post install – the good, the bad, the ugly?

After logging in all new and shiny Mavericks install the following:

  • Xcode via App Store

  • Xcode command line tools

    xcode-select --install
  • Homebrew

    ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
  • Check if Homebrew is working correctly. It might pop a warning if using case-sensitive file system.

    brew doctor
  • Homebrew Cask

    brew tap phinze/homebrew-cask
    brew install brew-cask
  • Enable TRIM support for non-Apple SSD (works for Samsung 830)

    sudo cp     /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
    sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
    sudo touch /System/Library/Extensions/
    sudo reboot
  • Alfred

    brew cask install alfred

    brew cask alfred link or manually add /opt/homebrew-cask/Caskroom as a Search Scope in Alfred's preferences

  • oh-my-Zsh

    curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
  • rbenv

    brew install rbenv ruby-build rbenv-gem-rehash
    echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc
  • Ruby 2.0

    rbenv install 2.0.0-p247
    rbenv global 2.0.0-p247
    gem update -—system
    gem install bundler
  • iTerm2, tmux

    brew cask install iterm2
    brew install tmux reattach-to-user-namespace
  • dotfiles

There is an excellent post about dotfiles management without using symlinks. It (perhaps) takes a bit more preparation and discipline in the beginning, but works perfectly on the long run.

mkdir ~/code/; git clone --bare git://github.com/tadejm/dotfiles.git ~/code/dotfiles.git

alias .G="git --git-dir=$HOME/code/dotfiles.git --work-tree=$HOME/"

echo 'alias .G="git --work-tree=$HOME/ --git-dir=$HOME/dotfiles.git"'
  • Rails

    gem install rails


Not sure if a clean install comes with a placebo effect. I doubt that an upgrade affects performance but I generally don't prefer it. Also a clean install gets rid of old–lying–around–files–from–15–months–ago.

The only argument, I could think of, against a clean install is the time spent for per-app configuration. I'm still looking for a way to share per app configuration like dotfiles in a Git repo.

8 Responses
Add your response


When you run brew doctor for the first time, does it throw any errors or complain? I've seen messages about unbrewed dylibs and the command line tools having an update (when it actually doesnt)

over 1 year ago ·

Won't a plain gem install rails work OOTB?

over 1 year ago ·

@dorfire, yes it will, Mavericks comes with Ruby 2.0.0. Of course none of us will use Ruby without a version managing tool like rbenv.

over 1 year ago ·

@rushiv I had 2 "out of the box" warnings:

  • My filesystem is CaSe SeNsItIvE so it prints a warning about Homebrew being less tested with that

  • The other warning was $PATH related; /usr/bin before /usr/local/bin

over 1 year ago ·

I am not the creator of this script but it has worked nicely for me. Check out lra / mackup on github

What does it do ?
Backups your application settings in Dropbox
Syncs your application settings among all your workstations
Restores your configuration on any fresh install in one command line
By only tracking pure configuration files, it keeps the crap out of your freshly new installed workstation (No cache, temporary and locally specific files are transfered).

over 1 year ago ·

@jasonben Thank you! Looks very interesting and just what I need. I'm definitely going ti try it out!

over 1 year ago ·
Avatar 73 normal

Looks like we share the same software stack. Thanks for the time you saved me !

over 1 year ago ·
Avatar lbr normal

This post is a keeper for getting on track with fresh and clean ruby install on OS X. Definitely in my Pinboard! Many thanks!

over 1 year ago ·