I just upgraded my MacMini Server from Lion Server to Mountain Lion using OS X Server. I am having the same problem with PostgreSQL that I did last year when I first instal
First remove the installed postgres:
sudo apt-get purge postgr*
sudo apt-get autoremove
Then install 'synaptic':
sudo apt-get install synaptic
sudo apt-get update
Then install Postgres
sudo apt-get install postgresql postgresql-contrib
i make in word by doing this:
dpkg-reconfigure locales
and choose your preferred locales
pg_createcluster 9.5 main --start
(9.5 is my version of postgresql)
/etc/init.d/postgresql start
and then it word!
sudo su - postgres
psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket"/var/pgsql_socket/.s.PGSQL.5432"?
I kept on getting the above error and none of the above solutions worked for me. Finally the following solution solved my problem on Mac OS X
Install postgres using brew
brew install postgres
Install brew services
brew tap homebrew/services
To start postgres as a background service
brew services start postgresql
To stop postgres manually
brew services stop postgresql
We can also use brew services to restart Postgres
brew services restart postgresql
Can you check your postgresql.conf file ??
On what port your postgres is running ??
I think it is not running on port 5432.If not change it to 5432
OR on terminal use
psql -U postgres -p YOUR_PORT_NUMBER database_name
Try paste in console this:
$ mkdir /var/pgsql_socket/
$ ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
A much more simple solution (thanks to http://daniel.fone.net.nz/blog/2014/12/01/fixing-connection-errors-after-upgrading-postgres/) . I had upgraded to postgres 9.4. In my case, all I needed to do (after a day of googling and not succeeding)
gem uninstall pg
gem uninstall activerecord-postgresql-adapter
bundle install
Restart webrick, and done!