gpt4 book ai didi

ruby-on-rails - rails 4 + Postgres : Randomly cannot connect to development server

转载 作者:行者123 更新时间:2023-11-29 13:51:37 33 4
gpt4 key购买 nike

我正在运行 Rails 4.2.2,我的 postgres gem 是 0.17.1,昨天一切正常,但今天当我打开控制台并尝试连接到数据库时,我看到了这个错误:

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 连接到数据库时,我看到以下内容:

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

据我所知,自昨天以来我没有更改任何内容,所以我不确定为什么会这样。我尝试将 host: localhost 添加到我的 database.yml 但没有成功。可能值得注意的是,当我尝试使用 PSequel 等程序连接到数据库时,我看到以下内容:

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?

有人见过这个吗?

最佳答案

Neara 对这篇文章的回复为我提供了答案:PostgreSQL server won't stop .

基本上必须运行:

$ brew services list
$ brew services restart postgresql

他们发布了一个解决方法,以防找不到服务

关于ruby-on-rails - rails 4 + Postgres : Randomly cannot connect to development server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40022167/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com