Homebrew postgres broken

前端 未结 8 1701
野趣味
野趣味 2020-12-07 08:49

I installed Postgresql 9.4.0 installed on my Mac (10.10.1/Yosemite) using homebrew. It does not work.

I have created the softlink to /usr/local/opt/postgresql/homebr

相关标签:
8条回答
  • 2020-12-07 09:49

    For posterity, I had this issue and wanted to note what worked for me.

    I am running postgres 11.2 on High Sierra. I had recently upgraded from postgres 10 with brew postgresql-upgrade-database.

    I kept getting the error psql: could not connect to server: No such file or directory, and my server.log indicated is another postmaster (PID 5894) running in data directory "/usr/local/var/postgres"?

    I tried several solutions including restarting my computer, deleting postmaster.pid, using brew services restart postgres, but to no avail. I eventually stumbled on the solution:

    brew unlink postgresql && brew link postgresql

    No idea why this worked, but putting it here mostly so I can reference it myself in the future! Throw stuff at the wall till it sticks!

    0 讨论(0)
  • 2020-12-07 09:49

    I recently had a problem which began when I upgraded some brew updates / upgrades, mainly python versions etc. What worked for me.

    brew uninstall postgres
    brew install postgresql@9.5
    echo 'export PATH="/usr/local/opt/postgresql@9.5/bin:$PATH"' > ~/.zshrc
    # you may need > ~/.bashrc if you use bash
    

    I needed pg_dump, pg_restore etc so to get that working I did

    brew install libpq
    

    Start the service

    brew services start postgresql@9.5
    

    From here I would have expected everything to work but still all rails db commands were giving error that server was not running. This final bit was the missing piece of the puzzle which finally solved it for me.

    gem uninstall pg
    gem install pg -v 0.20.0 # which was set in Gemfile
    # could also just probably do bundle install instead.
    
    0 讨论(0)
提交回复
热议问题