Heroku pg:pull正在给sh:createdb:命令未找到

Don*_*n P 4 postgresql heroku pgadmin

当我尝试这样做时heroku pg:pull DATABASE_URL myappspassword,我收到此错误:

my-computer:a-folder (master*) · heroku pg:pull DATABASE_URL myappspassword
 !    sh: createdb: command not found
 !    
 !    Unable to create new local database. Ensure your local Postgres is working and try again.
Run Code Online (Sandbox Code Playgroud)

一旦谷歌搜索没有返回结果.我想知道这是否与我这样做有关which psql,没有结果.也许我需要用pgAdmin来做一些特别的工作(例如导出命令行工具)?

dB'*_*dB' 10

您是否在Mac上,偶然使用Postgres App

如果是这样,问题可能createdb不在你的道路上.尝试通过插入以下内容来添加它~/.bash_profile.

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
Run Code Online (Sandbox Code Playgroud)

然后运行source ~/.bash_profile并再试一次.

有关Postgres App网站的更多信息:http://postgresapp.com/documentation/cli-tools.html


Ale*_*lex 2

你的直觉是正确的。您需要能够从命令行访问 Postgres。pg:pull正在尝试创建一个新的本地数据库并将相关数据从 Heroku 数据库放入其中。来自文档

\n\n
\n

此命令将创建一个名为 \xe2\x80\x9cmylocaldb\xe2\x80\x9d 的新本地数据库,然后从 DATABASE_URL 处的数据库中提取数据...

\n
\n\n

基本上,您的本地计算机正在尝试createdb在本地运行,但您的终端无法识别它。

\n