如何validationPostgreSQL 9已经在CentOS服务器上正确安装?

我试图在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可能是拿起旧的开发库。 通常你会添加/usr/pgsql-9.0/include/到你的包含。

由于您正在运行最新版本的PostgreSQL,因此它似乎不太可能太旧了。 我会查看任何产生该错误的源代码,并在那里寻找一个错误。 它是如何计算PostgreSQL是“太旧”?

粘贴从https://stackoverflow.com/questions/15301026/pg-gem-install-fails-saying-version-is-too-old/28284126#28284126

直到我意识到postgresql-develpostgresql-libs来自8.1.23 !!!

 $ yum list installed postgres* Loaded plugins: fastestmirror, security Installed Packages postgresql-devel.i386 8.1.23-10.el5_10 installed postgresql-devel.x86_64 8.1.23-10.el5_10 installed postgresql-libs.i386 8.1.23-10.el5_10 installed postgresql-libs.x86_64 8.1.23-10.el5_10 installed --------------- $ sudo yum install postgresql94-libs $ sudo yum install postgresql94-devel $ gem install pg Successfully installed pg-0.18.1