Heroku CLI无法连接Heroku Postgres的解决方法

4
正如标题所述,我无法连接到我的Heroku Postgres数据库。
当我运行连接命令时,会返回以下消息。
heroku pg:psql postgresql-metric-xxxxx --app app-name
--> Connecting to postgresql-metric-xxxxx
 !    The local psql command could not be located. For help installing psql, see
 !    https://devcenter.heroku.com/articles/heroku-postgresql#local-setup

但是我已经在运行Windows 10的系统中安装了PostgreSQL。


你能在本地运行psql命令吗? - Mavi Domates
4个回答

3

记得更新你的PATH环境变量以添加Postgres安装的bin目录。该目录类似于以下路径: C:\Program Files\PostgreSQL<版本号>\bin。 如果忘记更新PATH,像 heroku pg:psql 这样的命令将无法正常工作。


2
为了连接到postgresql,您仍需要在本地安装postgresql客户端。
在Mac上,您可以使用命令brew install postgresql进行安装。
在Windows上,您可以在这里找到安装链接。
在Linux上,这取决于您的发行版。但是apt-get install postgresql命令可能是您要寻找的内容。

0

可能 "pqsl" 不在 PATH 中,所以运行

PATH=%PATH%;C:\Program Files\PostgreSQL\9.2\bin

0

在第一次安装时,即使您添加了路径,如果终端无法加载,请尝试通过关闭并重新打开终端来重启。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接