gpt4 book ai didi

ruby-on-rails - 停止 postgres 进程重新启动 - mac

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

我正在尝试运行我的 Rails 项目,但它一直在下降,因为它依赖于运行的 postgres。当我尝试启动 postgres 时,它一直说它已经在运行(或端口已被占用)。我检查了事件监视器,有大约 6 个 postgres 进程在运行,当我尝试终止/强制退出进程时,它们再次出现...

不确定如何解决这个问题。

运行 postgres -D/usr/local/var/postgres 时的实际错误:

LOG: could not bind IPv6 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. LOG: could not bind IPv4 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. WARNING: could not create listen socket for "localhost" FATAL: could not create any TCP/IP sockets

当我尝试使用 pg_ctl -D/usr/local/var/postgres stop -s -m fast 停止 postgres 时,我收到此错误:

pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist Is server running?

最佳答案

我最终从头开始:

  • 通过自制软件卸载 postgres (brew uninstall postgresql)
  • 通过卸载程序卸载 postgres (/Library/Postgresql/version/uninstall)
  • 通过文件系统删除postgres(删除文件夹:/Library/Postgresql/)

然后只需进行自制软件安装:

brew install postgresql

并手动启动 postgres。

关于ruby-on-rails - 停止 postgres 进程重新启动 - mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38084945/

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