2016-10-13 13 views
1

Rails 4.2.2と私のpostgres gemは0.17.1です。このエラー:Rails 4 + Postgres:ランダムに開発サーバーに接続できません

PG::ConnectionBad: 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"? 

...私はpsqlを実行してデータベースに接続しようとしたときに、私は以下を参照してください。私の知る限り私はので、私は昨日、変更anythingsinceをhaventは知っ

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib 
    Referenced from: /usr/local/bin/psql 
    Reason: image not found 
Abort trap: 6 

なぜこれが起こっているのかわからない。私は幸運と私のdatabase.ymlにhost: localhostを追加しようとしました。私がPSequelのようなプログラムを使用してDBに接続しようとすると、私は以下を参照してください。注目に値することがあります

could not connect to server: Connection refused 
    is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? 

はこれを見て、誰がいますか?

+0

あなたはpostgresサーバを再起動します: sudo service postgresql restart –

+0

「sudo:service:command not found」と表示されます。 –

答えて

0

この投稿へのニアの応答は私のための答えを提供しました:PostgreSQL server won't stop。彼らが見つからない場合servicesに回避策を掲載

$ brew services list 
$ brew services restart postgresql 

は基本的に実行する必要がありました。

関連する問題