-bash: pg_dump: command not found

穿精又带淫゛_ 提交于 2019-12-22 18:12:30

问题


I'm trying to pull a production database locally for my rails app. My local postgres version was too low so I needed to update to Postgresql 9.6.5 from 9.4.1.

I installed Postgres 9.6.6 via Homebrew as such:

brew install postgresql@9.6

Then ran:

brew services start postgresql@9.6

However, when I try to do pg_dump I get -bash: pg_dump: command not found.

I also tried updating my path as such:

export PATH="/usr/local/Cellar/postgresql\@9.6/9.6.6/bin:$PATH"

Any idea what I need to do to get pg_dump to work?


回答1:


Adding this to my ~/.bash_profile did the trick:

export PATH=/usr/local/Cellar/postgresql\@9.6/9.6.6/bin:$PATH




回答2:


Couldn't get path to work in Cygwin but could browse to my pg bin directory (C:\Program Files\PostgreSQL\9.6\bin) and run it directly from there.



来源:https://stackoverflow.com/questions/48362443/bash-pg-dump-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!