我正在尝试在 CentoOS 服务器上安装 PG (postgres) gem,但它一直说 Postgres 太旧,即使我已将其升级到 9.1.3(按照此处的说明http://www.davidghedini。 com/pg/entry/install_postgresql_9_on_centos)。
我正在使用 CentOS 5.8(和 Ruby 1.9.3)
这是错误消息:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... no
Your PostgreSQL is too old. Either install an older version of this gem or upgrade your database.
*** 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.
psql --version 确认我的版本:psql (PostgreSQL) 9.1.3
我可以确认安装的包:
Setting up Install Process
Package postgresql91-9.1.3-1PGDG.rhel5.x86_64 already installed and latest version
Package postgresql91-devel-9.1.3-1PGDG.rhel5.x86_64 already installed and latest version
Package postgresql91-server-9.1.3-1PGDG.rhel5.x86_64 already installed and latest version
Package postgresql91-libs-9.1.3-1PGDG.rhel5.x86_64 already installed and latest version
Package postgresql91-contrib-9.1.3-1PGDG.rhel5.x86_64 already installed and latest version
Nothing to do
关于如何解决这个问题的任何想法?提前致谢。
由于您运行的是最新版本的 PostgreSQL,因此它似乎不太可能真的太旧了。我会查看生成该错误的源代码并在其中查找错误。它是如何计算出 PostgreSQL 是“太旧”的?
您的 ruby gem 可能正在使用旧的开发库。通常,您会将 /usr/pgsql-9.0/include/ 添加到您的包含中。
粘贴自https://stackoverflow.com/questions/15301026/pg-gem-install-fails-saying-version-is-too-old/28284126#28284126
直到我意识到这一点
postgresql-devel
并且postgresql-libs
来自8.1.23
!!!