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
This is quite easy than your think because If you update your mac then process is running but postmaster.pid
file is missing from /usr/local/var/postgres/
here. so you need to start process for postgres which create postmaster.pid.
If progress is running then -
Stop manually:
pg_ctl -D /usr/local/var/postgres stop -s -m fast
Start manually:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
now all are working...