One of the things I wanted to do when I very destructively changed my blog to Octopress was better document the things I do with my computer so that I can find it in the future. A recent project has lead me down a rabbit hole towards CouchDB, and since I do my development on a Mac, I need a local instance. For the record, installation on Ubuntu, like what my servers run, is super-duper easy:

`One of the things I wanted to do when I very destructively changed my blog to Octopress was better document the things I do with my computer so that I can find it in the future. A recent project has lead me down a rabbit hole towards CouchDB, and since I do my development on a Mac, I need a local instance. For the record, installation on Ubuntu, like what my servers run, is super-duper easy:

`

Mac installation, however, wasn’t quite as easy, but it was close. I’m using Homebrew as my package manager since I’ve had a sordid past with MacPorts. After installing Homebrew, I just needed to have it install CouchDB. Here’s all the code I ran:

“`bash Mac Installation

Install Homebrew – only need to do this once

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

Install CouchDB and dependencies

brew install couchdb -v

“`

I added the -v flag because I wanted to make sure it wasn’t locking up, since my first attempt at an install didn’t go so well. However, attempt #2 went swimmingly, and I’m installing it on my MacPro right now. So far, so good.

Update Always run on verbose! Turns out I’m having a problem downloading one of the dependent files, so it’s halting. Rerunning the brew install step will eventually fix it by finally getting the whole file. Sounds hacky, is hacky.

Because I want to have CouchDB running when the machine is and not think about it, I needed to add a launchd script to my startup. I was guided how to do so by running “brew info couchdb”, but for posterity, here’s my transcript:

“`bash Launch on Login Configuration

To get the help

brew info couchdb

[…]

mkdir -p ~/Library/LaunchAgents

cp /usr/local/Cellar/couchdb/1.1.1/Library/LaunchDaemons/org.apache.couchdb.plist ~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/org.apache.couchdb.plist

“`

That’s it! I now have a working installation of CouchDB on my Macs! If you’re playing along with the home game, here’s a link to the admin console.

Welcome to the Admin Party!