When I run the rake db:migrate or run the rails s command, I get the same error:
rake db:migrate
rails s
Error : could not connect to server: No such file or
Solution:
Try this
export LC_ALL="en_US.UTF-8"
and this. (9.3 is my current PostgreSQL version. Write your version!)
sudo pg_createcluster 9.3 main --start