Skip to content

Instantly share code, notes, and snippets.

@chadwithuhc
Last active November 8, 2017 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadwithuhc/92da0c81fde7477407ebe188710271bc to your computer and use it in GitHub Desktop.
Save chadwithuhc/92da0c81fde7477407ebe188710271bc to your computer and use it in GitHub Desktop.

The error was most likely caused by a brew upgrade command that upgraded postgres and now no longer connects correctly.

You can follow the commands below but you will lose prior databases.

$ brew services stop postgres
$ cd /usr/local/var
$ ls

You should see postgres folder. Next we'll move it to a backup.

$ mv postgres postgres-old
$ ls

You should see the renamed postgres folder

Next, we need to uninstall and reinstall postgres. Using --force will uninstall all versions of postgres.

$ brew uninstall --force postgres
$ brew install postgres
$ brew services start postgres

Then, recreate any databases you were using

createdb _username_
migrate & seed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment