Skip to content

Instantly share code, notes, and snippets.

@davidkelley
Created September 13, 2013 09:35
Show Gist options
  • Save davidkelley/6548536 to your computer and use it in GitHub Desktop.
Save davidkelley/6548536 to your computer and use it in GitHub Desktop.
Commands to setup Postgresql on OS X.
#!/bin/bash
brew update
brew doctor
brew uninstall postgresql || true
brew install postgresql
initdb /usr/local/var/postgres -E utf8
gem install lunchy
mkdir -p ~/Library/LaunchAgents
$PATH=`find /usr/local/Cellar -name "*.postgresql.*"`
cp $PATH ~/Library/LaunchAgents/
lunchy start postgres
#Uninstall the postgres gem and re-install it to adjust make paths
gem uninstall pg || true
gem install pg
echo "Use the lunchy gem to control your postgresql install"
echo "Create a database now: $ createdb database_name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment