无法获得Postgres.app连接

时间:2013-06-23 09:05:01

标签: ruby-on-rails-3 postgresql osx-mountain-lion

我正在使用Mountain Lion,并希望将我的rails应用程序从SQLIte切换到Postgres,以便我可以在Heroku上部署。我已经安装了Postgres.app,如果我用建议的路径打开它,它工作正常:

/Applications/Postgres.app/Contents/MacOS/bin/psql ; exit;

但每当我跑

which psql

我明白了:

/usr/bin/psql

与Mountain Lion捆绑在一起的并不是我想要的。从阅读它是一个路径问题,但文档说要添加:

PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

到.bashrc,我已经完成了。那个文件看起来像这样:

export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

我做错了什么?

1 个答案:

答案 0 :(得分:1)

您是否在终端窗口中运行source ~/.bashrc以使用新设置?或者关闭/打开?

您也可以使用echo $PATH检查当前的$ PATH,看看您添加的Postgres.app目录是否存在。


使用最终解决方案进行更新:将该行添加到~/.bash_profile文件中,因为这是Mountain Lion自动提供的文件。