首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在CentOS 6上为Rails安装捆绑包时,PostgreSQL gem失败

在CentOS 6上为Rails安装捆绑包时,PostgreSQL gem失败
EN

Stack Overflow用户
提问于 2019-05-03 00:44:55
回答 2查看 78关注 0票数 0

我已经尝试了所有的解决方案,所以我非常感谢任何帮助。

我安装了以下PostgreSQL项目:

代码语言:javascript
复制
postgresql96.x86_64 - 9.6.12-1PGDG.rhel6
postgresql96-devel.x86_64 - 9.6.12-1PGDG.rhel6
postgresql96-libs.x86_64 - 9.6.12-1PGDG.rhel6
postgresql96-server.x86_64 - 9.6.12-1PGDG.rhel6

当我运行bundle install时,我得到以下错误:

代码语言:javascript
复制
Installing pg 1.1.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: 
/home/admin/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/pg-1.1.4/ext
/home/admin/.rbenv/versions/2.6.1/bin/ruby -I 
/home/admin/.rbenv/versions/2.6.1/lib/ruby/2.6.0 -r ./siteconf20190502-8579-10nqtt0.rb extconf.rb
--with-pg-config\=/opt/local/lib/postgresql91/bin/pg_config
Using config values from /opt/local/lib/postgresql91/bin/pg_config
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

大多数指南都说我们需要安装devellibs包,但它们已经安装了。我使用的是CentOS 6。

谢谢!

另外,我应该补充说,我正在使用yum作为我的包管理器,谢谢。

EN

回答 2

Stack Overflow用户

发布于 2019-05-03 00:49:16

我很确定你也需要postgres客户端工具...在服务器上编译postgres时。您应该为postgres服务器和命令行工具安装devel包。

票数 0
EN

Stack Overflow用户

发布于 2019-05-03 01:17:49

看起来像是postgresql-devel附带的CentOS libpq-fe.h报头

代码语言:javascript
复制
yum install postgresql-devel

参考https://stackoverflow.com/a/6040822/4950680

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55956905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档