首先请注意,我在Stack Overflow和整个网络上找到了几个类似的问题和文章,但是没有一个能帮助我解决我的问题:
- PG错误无法连接到服务器: Connection refused Is the server running on port 5432?
- PG :: ConnectionBad - 无法连接到服务器: Connection refused
- psql:无法连接到服务器:Connection refused
现在,问题如下:
- 我有一个工作得很好的Rails应用程序。
- 与我的合作者一起,我们使用GitHub共同工作。
- 我们有一个
master
分支和一个mvp
分支。 - 我最近使用Homebrew(Mac)更新了我的
git
版本。 - 我们使用Foreman在本地启动应用程序。
现在,当我尝试在本地启动应用程序时,我会收到以下错误:
PG::ConnectionBad at /
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
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?
我尝试了多次重新启动我的计算机。
我还检查了/usr/local/var/postgres
的内容:
PG_VERSION pg_dynshmem pg_multixact pg_snapshots pg_tblspc postgresql.conf
base pg_hba.conf pg_notify pg_stat pg_twophase postmaster.opts
global pg_ident.conf pg_replslot pg_stat_tmp pg_xlog server.log
pg_clog pg_logical pg_serial pg_subtrans postgresql.auto.conf
您可以看到,那里没有postmaster.pid
文件。
您有任何解决此问题的想法吗?
postgresql.conf
的内容? - Pavanbrew reinstall postgresql@13
解决了我的问题。(我的项目需要使用v13) - Shrabanee