Skip to content

Instantly share code, notes, and snippets.

@covard
Last active December 19, 2015 08:49
Show Gist options
  • Save covard/5928666 to your computer and use it in GitHub Desktop.
Save covard/5928666 to your computer and use it in GitHub Desktop.
Install PostgreSQL with Homebrew and brew services. This is a step by step instruction on installing postgres.

This gist is for installing PostgreSQL using Hombrew and the luncy gem.

$ brew install postgresql

When you install Postgres, you will see a bunch of output in your Terminal. The important sections are Build Notes, Create/Upgrade a Database, and Start/Stop PostgreSQL. Make sure to follow those instructions to the letter.

Create and upgrade a DB

$ initdb /usr/local/var/postgres -E utf8

Homebrew services

$ brew tap gapple/services

Now you can do brew services start/stop/list postgres

$ brew services start postgres
$ brew services list
$ brew services stop postgres

Optional need to create a user or whatever username you want, the -W will prompt for you password, enter your password from your database.yml file

$ createuser -s [username] -W 

This gist is from this post - credit where credit is due http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/

(gist modified to use brew services)

Happy Rubying =)

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