gpt4 book ai didi

ruby-on-rails - 硬重启后无法连接到 Postgresql(在 Rails 中)

转载 作者:IT王子 更新时间:2023-10-29 06:05:19 24 4
gpt4 key购买 nike

我的 mac 锁住了,所以我不得不硬关机(按住电源键直到它关闭,然后再打开它)。现在,当我尝试启动我的本地 Rails 应用程序(崩溃前运行良好)时,我收到以下 Action Controller 异常:

PG::ConnectionBad
could not connect to server: No such file or directory Is the server
running locally and accepting connections on Unix domain socket
"/var/pgsql_socket/.s.PGSQL.5432"?

大约一个月前,当我的计算机崩溃时,我遇到了类似的问题,我最终找到了解决方案。但我已经搜索和研究了几个小时,但今天运气不好。

我几乎是个菜鸟,但为了它的值(value),我正在使用 foreman start 启动服务器并使用 Redis .但老实说,我不知道它们到底是做什么的。

谢谢。

最佳答案

这通常对我有用。

$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
$ pg_ctl restart -D /usr/local/var/postgres
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

关于ruby-on-rails - 硬重启后无法连接到 Postgresql(在 Rails 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37336372/

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