<分区>
我正在尝试在我的 Mac (10.7 Lion) 上为 Rails 应用程序在本地设置 postgres。
我安装了 postgresapp并启动它,现在我的状态栏中有一只大象告诉我 postgres 正在运行。
我可以通过:
psql -h localhost
但是当我简单地运行 psql
时,我得到了这个错误:
psql: could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
我把这个:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
在 ~/.bashrc
中打开一个新的终端。但是没有骰子。
当我运行 which psql
时,我得到 /usr/bin/psql
不太确定该怎么做。我对 unix 系统还是很陌生。我应该将 /usr/bin/psql
符号链接(symbolic link)到 /Applications/Postgres.app/Contents/MacOS/bin/psql
吗?