postgresql 在 RHEL 6.5 libpq-fe.h 上安装 RPostgreSQL 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26302960/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install RPostgreSQL on RHEL 6.5 libpq-fe.h Error
提问by Serban Tanasa
I have RHEL 6.5 Server with an installation of R (3.1.1) & RStudioServer (0.98.1062)
我有安装了 R (3.1.1) 和 RStudioServer (0.98.1062) 的 RHEL 6.5 服务器
I have postgresql-9.3 installed and handling a large database. In order to connect R to PostgreSQL, I have in the past used the RPostgreSQL (still do on my CentOS 7 Workstation). However, attempting to compile under RHEL 6.5 I get an error
我安装了 postgresql-9.3 并处理了一个大型数据库。为了将 R 连接到 PostgreSQL,我过去曾使用过 RPostgreSQL(在我的 CentOS 7 工作站上仍然如此)。但是,尝试在 RHEL 6.5 下编译时出现错误
In file included from RS-PQescape.c:7:
RS-PostgreSQL.h:23:26: error: libpq-fe.h: No such file or directory
The file is located on my system here:
该文件位于我的系统上:
/usr/pgsql-9.3/include/libpq-fe.h
Libpq is part of the Postgres installation, but RPostgreSQL cannot find it:
Libpq 是 Postgres 安装的一部分,但 RPostgreSQL 找不到它:
[root@server /]# yum list libpq*
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Installed Packages
libpqxx.x86_64 1:4.0.1-1.rhel6 @pgdg93
libpqxx-debuginfo.x86_64 1:4.0.1-1.rhel6 @pgdg93
libpqxx-devel.x86_64 1:4.0.1-1.rhel6 @pgdg93
Is there any way to tell RPostgreSQL where to look (symbolic links?) or some other workaround? This should be simple, but I've wasted several hours on this already...
有什么方法可以告诉 RPostgreSQL 在哪里查看(符号链接?)或其他一些解决方法?这应该很简单,但我已经浪费了几个小时......
回答by Curlew
Followup info because I just had the same problem.
Installing yum install postgresql-devel
resolves the error too.
后续信息,因为我刚刚遇到了同样的问题。
安装也yum install postgresql-devel
解决了错误。
回答by Serban Tanasa
I ended up looking into the RPostgreSQL configure file in the tarball, searched for the file name the script couldn't find and decided it was easiest to create an environmental variable:
我最终查看了 tarball 中的 RPostgreSQL 配置文件,搜索了脚本找不到的文件名,并决定创建环境变量最简单:
export PG_INCDIR=/usr/pgsql-9.3/include/
导出 PG_INCDIR=/usr/pgsql-9.3/include/
Worked like a charm after that.
在那之后工作就像一个魅力。
If you have sudo rights, you could also try:
如果你有 sudo 权限,你也可以尝试:
yum install postgresql-devel
yum 安装 postgresql-devel