【问题标题】:Mac OS Yosemite PostgreSQLMac OS 优胜美地 PostgreSQL
【发布时间】:2014-12-13 13:38:35
【问题描述】:

我刚刚更新到 Yosemite,我的 postgres 版本无法运行,我收到了来自 rails 的以下消息:

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

即使我已经多次启动服务器

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

我正在尝试从自制软件中取消链接 postgreSQL 并重新安装,但我不知道它是否会工作。

【问题讨论】:

    标签: macos postgresql ruby-on-rails-4 osx-yosemite


    【解决方案1】:

    只需要取消链接 postgreSQL

    brew unlink postgresql
    

    然后

    xcode-select --install
    

    最后

    brew install postgresql
    
    brew install openssl
    

    但后来 Rails 服务器无法正常工作:

    rvm get stable
    

    查看哪个是我的 current_ruby

    rvm list
    
    sudo rvm uninstall <current_ruby>
    
    rvm install <current_ruby>
    

    现在创建初始化一个 postgredb

    initdb /usr/local/var/postgres9.3.5
    

    然后启动你的服务器

    pg_ctl -D /usr/local/var/postgres9.3.5 -l logfile start
    

    你已经完成了。

    【讨论】:

    • 很有帮助。我也必须重新创建此答案中提到的文件夹:stackoverflow.com/a/26001639/307308
    • 你创造了我的生活!我错过了 initdb 步骤
    • Running xcode-select --install 告诉我“xcode-select: error: 命令行工具已经安装,使用“软件更新”来安装更新”
    猜你喜欢
    • 1970-01-01
    • 2014-12-13
    • 2015-09-09
    • 2015-06-02
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多