And*_*nov 7 postgresql mac-osx lion
我正在尝试在相对干净的 Lion 安装上设置 pg,但没有成功。
首先我成功安装了自制软件,并安装了 postgresql 没有任何错误。
然后我尝试运行一个 rails 应用程序,出现错误。尝试运行此脚本:http : //nextmarvel.net/blog/2011/09/brew-install-postgresql-on-os-x-lion/
为了隐藏默认系统 postgres 安装,但现在我收到以下错误:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
当我尝试postgres在 bin 目录中运行脚本时,出现以下错误:
larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit;
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
logout
Run Code Online (Sandbox Code Playgroud)
很明显,postgres 无法启动,因为它没有正确配置。有没有人对配置它的正确方法有任何建议,以便它启动?
跑步brew info postgres为您提供了使事情顺利进行的基础知识。例如:
如果这是您的第一次安装,请使用以下命令创建数据库:
initdb /usr/local/var/postgres -E utf8
Run Code Online (Sandbox Code Playgroud)
或者重启数据库服务器:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Run Code Online (Sandbox Code Playgroud)
一味运行具有不知道他们在做什么解决不了问题的自制脚本-它CREATES他们。结束咆哮。
我们不知道您之前遇到的错误是什么,但现在您显然没有配置数据库集群。
您需要正确设置 Postgres 集群(请参阅Postgres 手册),和/或在启动时告诉 postgres 数据库集群所在的位置(这You must specify the --config-file or -D invocation option or set the PGDATA environment variable.是错误消息中的那一点)。 手册的第 17.3 节谈到了这一点。
| 归档时间: |
|
| 查看次数: |
17376 次 |
| 最近记录: |