【发布时间】:2019-01-03 01:18:18
【问题描述】:
自从将我的 Mac OS 升级到 Mohave 后,我一直在家庭网络中本地运行我的 rails 服务器时遇到问题。我说家庭网络的原因是因为当我在办公室连接到网络时它工作得很好。当我运行 rails s 并转到 localhost:3000 时,我看到日志正在工作并正在运行查询以从我的 PG 数据库中获取数据,直到它最终停止并超时并出现以下错误:
[2019-01-02T20:13:21.417980 #65251] INFO -- : method=GET path=/ format=html controller=DashboardController action=index status=500 error='ActionView::Template::Error: could not connect to server: Operation timed out
Is the server running on host "172.18.8.52" and accepting
TCP/IP connections on port 5432?
我尝试使用 brew 重新安装 PG,我还尝试更改端口。我检查了我的防火墙,没有任何东西阻止 5432 端口。奇怪的是,我可以使用我的 PSequel GUI 通过 localhost 的 5432 端口连接到 PG。
接下来引起我注意的是错误消息中列出的 IP 地址。我不认识它。做完nslookup 172.18.8.52我得到:
nslookup 172.18.8.52
Server: 2001:558:feed::1
Address: 2001:558:feed::1#53
** server can't find 52.8.18.172.in-addr.arpa: NXDOMAIN
谁能指出我正确的方向?这让我发疯了!
我正在运行 Rails 5.1.4。
谢谢你!
【问题讨论】:
标签: ruby-on-rails postgresql macos