You are watching: Pg::connectionbad: could not connect to server: no such file or directory
home/dartnyan/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize": can not attach to server:No such document or brochure (PG::ConnectionBad)Is the server to run locally and also acceptingconnections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?database.yml
default: &default adapter: postgresql pool: 5 imeout: 5000development: adapter: postgresql database: shop_development pool: 5 username: dartnyan password: kurt1245test: adapter: postgresql encoding: unicode database: shop_test pool: 5 username: dartnyan password: kurt1245
I found that inputting the following into terminal helps:
$ cd /usr/local/var/postgres/$ rm postmaster.pidI uncovered this end at http://alumni.lewagon.org/questions/60
It additionally describes what could be happening. The document may acquire corrupt if Postgresql was not closed "gracefully". Instance would it is in if her battery on her laptop to be to die.
Looks prefer the postgres server isn"t running. Begin the server by running
sudo business postgresql begin
On her terminal, please run this command
rm /usr/local/var/postgres/postmaster.pidor if you have actually a specific version the postgres:
## version 11 for examplerm /usr/local/var/postgresql
In mine case, this is caused by an upgrade of mac os, my configuration is Ruby 2.6.3 and also rails 220.127.116.11 and also I require PostgreSQL 12, verify that you have actually the correct variation of PostgreSQL reinstall if girlfriend need and finally execute in her project:
gem uninstall pg
Thanks because that contributing an answer to stack Overflow!Please be sure to answer the question. Carry out details and share your research!
But avoid …Asking because that help, clarification, or responding to other answers.Making statements based upon opinion; back them increase with referrals or personal experience.
See more: Ejercicio Para Aumentar El Busto Con Remedios Caseros, Aumentar Busto
To discover more, see our tips on writing good answers.
article Your answer Discard
Not the answer you're looking for? Browse various other questions tagged ruby-on-rails postgresql or ask your very own question.
site style / logo © 2021 ridge Exchange Inc; user contributions licensed under cc by-sa. Rev2021.10.14.40466