gpt4 book ai didi

ruby-on-rails - 升级到 Yosemite 10.10 后无法连接到 postgresql 数据库

转载 作者:数据小太阳 更新时间:2023-10-29 06:26:12 32 4
gpt4 key购买 nike

更新到 Yosemite 10.10 后,我无法连接到我的 postgresql 数据库。我运行 Rails 控制台并尝试获取第一个用户,但出现此错误...

>     ➜  game_golf git:(master) ✗ rails c
> Loading development environment (Rails 4.1.4)
> [1] pry(main)> User.first
> PG::ConnectionBad: 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?
> from /Users/pauldornfeld/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize'
> [2] pry(main)>

我该怎么办!我试图重新安装 postgresql,重新安装自制软件。请帮忙!

最佳答案

我找到了 this .

cd /usr/local/var/postgres
mkdir pg_tblspc pg_twophase pg_stat_tmp

它对我有用。

关于ruby-on-rails - 升级到 Yosemite 10.10 后无法连接到 postgresql 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26447736/

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