Skip to content

Instantly share code, notes, and snippets.

@johno
Last active August 29, 2015 14:28
Show Gist options
  • Save johno/63ad2ab32c1333426cd8 to your computer and use it in GitHub Desktop.
Save johno/63ad2ab32c1333426cd8 to your computer and use it in GitHub Desktop.
brew install postgresql                                               # Ensure you're running 9.4+
ln -sfv /usr/local/opt/postgresql/*plist ~/Library/LaunchAgents       # Autostart pg
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist  # Reload config

rvm install ruby-2.1.6  # Make warning stop complaining
gem install bundler
gem install pg
bundle

postgres -D /usr/local/var/postgres  # Make sure pg is happy

# if postgres -D /usr/local/var/postgres fails
rm /usr/local/var/postgres/postmaster.pid                             # Nuke the process that stomps pg's socket
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist  # Reload the config
export PGHOST=localhost                                               # If it cannot find the db, the host may not be set

rake db:create   # Create the new db
rake db:migrate  # You know the drill
rspec            # Make sure everything is gravy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment