使用zsh安装Postgres(Heroku教程)

时间:2015-02-01 09:24:11

标签: ruby-on-rails ruby postgresql heroku

我正在通过Heroku跟踪Ruby入门。我正处于声明应用程序依赖关系https://devcenter.heroku.com/articles/getting-started-with-ruby#declare-app-dependencies)的步骤,我坚持在本地安装Postgres。

我使用zsh作为我的shell,所以我认为存在问题$PATH。我已成功下载Postgres并将其拖到我的Applications文件夹中。

这是我被困在

的地方
If you are using bash (default shell on OS X), add the following line to ~/.bash_profile:

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

我在~/.zshrc vi ~/.zshrc之后执行此操作,然后键入/PATH,然后将其添加到#User configuration部分。

但是,当我使用which psql命令检查它是否正常工作时,它会返回psql not found.

1 个答案:

答案 0 :(得分:0)

也许您重新启动了zsh终端。 因为zsh终端启动时会加载~/.zshrc

如果您想反映~/.zshrc配置,您有两种方法。(例如:adding export PATH=...

  1. 重新启动zsh终端。关闭(Ctrl + w)并启动终端应用程序。

  2. 使用source命令加载配置文件,如下所示。

    $ source ~/.zshrc