Centos

如何驗證 PostgreSQL 9 是否已正確安裝在 CentOS 伺服器上?

  • February 2, 2015

我正在嘗試在 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

有關如何解決此問題的任何想法?提前致謝。

您的 ruby​​ gem 可能正在使用舊的開發庫。通常,您會將 /usr/pgsql-9.0/include/ 添加到您的包含中。

由於您正在執行最新版本的 PostgreSQL,它似乎不太可能真的太舊了。我會查看產生該錯誤的任何原始碼並在其中查找錯誤。如何計算 PostgreSQL “太舊”?

引用自:https://serverfault.com/questions/395034