#postgres issues after computer shut down (or brew update, or sniffing the wind)
##Error Message:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"hacker_klone_development"}
##problem: old psql running in background, causing issues -or- computer using other version of psql installed
##Steps:
- remove old pid file
rm /usr/local/var/postgres/postmaster.pid
(pid is preventing postgres from starting up) (pid is recreated everytime psql starts)
- restart pg
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
pg_ctl --help
-
-D location of database storage area
-
-l write (or append) server log to FILENAME
———— also, try
uninstalling pg:
gem uninstall pg
then, installing the version you need bundle (inside directory)
##How to check if psql is running?
crud-and-rest-checkpoint-challenge :> ps aux | grep postgres
katkat 26928 0.0 0.0 2423356 196 s001 R+ 7:28PM 0:00.00 grep postgres
#Shotgun issues Fixing Shotgun Server Issues ########################################################################################## ##HOW TO FIX SHOTGUN SERVER ISSUES (see example below)
(0 - Cause) Exiting iTerm with server still running leads to phantom ruby/sinatra/rails whatever processes
#####EXAMPLE: