PostgreSQL - pg_config -bash:pg_config:找不到命令
我在 Mac 上使用 PostgreSQL 在 Rails 3 中构建应用程序...
PostgreSQL 工作正常,但在命令行中出现以下错误:
$ pg_config
-bash: pg_config: command not found
有人知道如何获取此设置以便我可以运行 pg_config?
谢谢
I'm on a Mac building an app in Rails 3 with PostgreSQL...
PostgreSQL is working fine but in the command line I get the following error:
$ pg_config
-bash: pg_config: command not found
Anyone know how to get this setup so I can run pg_config?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
你可以安装 postgresql-devel 来获得它。在基于 rpm 的发行版中将
起作用
或用于
获取确切的包
you can install postgresql-devel to get that. in rpm based distro
will work
or use
to get the exact package
除了安装 postgresql-devel 之外,我还必须修改 PATH 环境变量。例如,将其添加到您的
.bashrc
中:In addition to installing
postgresql-devel
I had to modify thePATH
environment variable. E.g. add this to your.bashrc
:我的问题是 pg_config 不在路径中。因此,我首先需要使用搜索
pg_config
的路径。记下路径后,我使用此命令安装 pg gem
,成功安装了
pg
。系统是CentOS。My problem was that
pg_config
was not in the PATH. So, I first needed to search forpg_config
's path by usingAfter noting the path, I used this command to install pg gem
That installed
pg
successfully. The system was a CentOS.pg_config 是一个 PostgreSQL 实用程序,您可以通过安装 PostgreSQL 来获取它。
在苹果电脑上:
pg_config is a PostgreSQL util, you can get it by installing PostgreSQL.
On mac:
查找
pg_config
所在位置:find / -name pg_config 2>/dev/null
复制路径,然后执行:
export PATH=/usr/local/pgsql/bin:$PATH
。确保使用正确的复制路径。Find where
pg_config
is located:find / -name pg_config 2>/dev/null
Copy the path then do:
export PATH=/usr/local/pgsql/bin:$PATH
. Make sure to use your correct copied path.pg_config
附带 PostgreSQL 的开发文件。转到您获取服务器守护程序的位置并在那里查找它们。pg_config
comes with the development files for PostgreSQL. Go to where you got the server daemon from and look for them there.我有一个带有 postgres 9.0 的 CentOS 5.11 和 python 2.4 、 python 2.6 来运行 openERP 6,尝试安装 psycopg2 我总是收到错误:
来自:如何安装 pg_config
后来我这样做:
我得到一个列表,我们可以在其中找到
,但如果我尝试安装,它已经安装了
所以我稍后使用
你需要为你的架构安装正确的版本(32位或64位),在我的例子中是:
然后更新
并最终使用 pip
pip install psycopg2 安装 psycopg2
i have a CentOS 5.11 with postgres 9.0, and python 2.4 , python 2.6 to run openERP 6, trying to install the psycopg2 i allways get the error:
from :how to install pg_config
Later i do :
i get a list, where we can find
but if i try to install, its already installed
So i use
later you need install the rigth vertion, for your architecture(32bit or 64bit), in my case was:
then update
and finally install psycopg2 with pip
pip install psycopg2