我已经尝试了所有的解决方案,所以我非常感谢任何帮助。
我安装了以下PostgreSQL项目:
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时,我得到以下错误:
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.大多数指南都说我们需要安装devel和libs包,但它们已经安装了。我使用的是CentOS 6。
谢谢!
另外,我应该补充说,我正在使用yum作为我的包管理器,谢谢。
发布于 2019-05-03 00:49:16
我很确定你也需要postgres客户端工具...在服务器上编译postgres时。您应该为postgres服务器和命令行工具安装devel包。
发布于 2019-05-03 01:17:49
看起来像是postgresql-devel附带的CentOS libpq-fe.h报头
yum install postgresql-develhttps://stackoverflow.com/questions/55956905
复制相似问题