I recently updated my machine (MacBook Pro running Mountain Lion) and ever since then, whenever I set up a rails project, my machine craps out and cannot connect to PG. Curr
Run in your command line
postgres -D /usr/local/var/postgres
If the result is like the next one
LOG: skipping missing configuration file "/usr/local/var/postgres/postgresql.auto.conf"
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.
Run
brew postgresql-upgrade-database
Based in this post