Centos 5,rails,bundle上的Postgresql 9.2-PostgreSQL太旧了 [英] Postgresql 9.2 on Centos 5, rails, bundle - PostgreSQL is too old

查看:124
本文介绍了Centos 5,rails,bundle上的Postgresql 9.2-PostgreSQL太旧了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我发疯了

首先,自石器时代以来我一直在使用的托管服务提供商正在拖延升级到Centos 6的脚步,从

First, my hosting provider that I have been with since the stone age, are dragging their feet about updating to Centos 6 and, from what I have read, I can see why.

我读了有关仅在Centos 5上更新PostgreSQL 9.2的说明 ,这是我运行捆绑安装所需要的全部,它告诉我PostgreSQL太旧了-PostgreSQL 8.1.23

Instead of waiting for the next ice age to pass, I read the instructions for just updating postgresql 9.2 on Centos 5, which is all I need to run my bundle install, which tells me that my PostgreSQL is too old - PostgreSQL 8.1.23

更新并启动后,这是返回的消息:

After updating and starting, here's the message back:

[root@vps data]# /etc/init.d/postgresql-9.2 start
/etc/rc.d/init.d/functions: fork: Cannot allocate memory
/etc/profile.d/lang.sh: line 53: /sbin/consoletype: Argument list too long
Starting postgresql-9.2 service:                           [  OK  ]

开始,很棒-钻机ht?

It started, great - right?

否,

[root@vps data]# psql --version
psql (PostgreSQL) 8.1.23
contains support for command-line editing

如果9.2已启动,那么为什么仍然显示8.1.23?

If 9.2 started, then why does it still say 8.1.23?

也许我只需要重新启动即可

Maybe I just need to reboot

reboot -i

在psql中重新启动--version仍显示PostgreSQL 8.1.23-WTF?

ssh back in psql --version still shows PostgreSQL 8.1.23 - WTF?

我运行/etc/init.d/postgresql-9.2 start-它启动-很好,很酷

I run /etc/init.d/postgresql-9.2 start - it starts - OK, cool

bundle install

Make sure that `gem install pg -v '0.17.1'` succeeds before bundling

gem install pg -v '0.17.1'

我仍然收到错误:

checking for PQconnectionUsedPassword()... no
Your PostgreSQL is too old. Either install an older version of this gem or upgrade your    database.
*** extconf.rb failed ***

所以,我的最终问题是:

So, my ultimate questions are:

如果PostgreSQL 9.2启动了,为什么它说我正在运行8.1.23?

If the postgresql 9.2 started, why does it say that I am running 8.1.23?

我可以吗?必须rm -rf整个/ usr / bin / psql并重新开始?

Do I have to rm -rf the entire /usr/bin/psql and start over?

推荐答案

PostgreSQL开发组有用于Pg的软件包在CentOS 5上为9.3。

The PostgreSQL Development Group has packages for Pg 9.3 on CentOS 5.

请参见 yum.postgresql。 org

但是,安装Pg 9.3不会删除8.1。它仍会保留在您的 PATH 上。

However, installing Pg 9.3 won't remove 8.1. It'll still be on your PATH. It'll still be running, too.

如果要使用9.3 psql libpq ,您需要更改 PATH LD_LIBRARY_PATH 以使用PostgreSQL 9.3安装。然后针对新的 libpq 重建 Pg gem。

If you want to use the 9.3 psql and libpq, you need to alter your PATH and LD_LIBRARY_PATH to prefer the PostgreSQL 9.3 install. Then rebuild the Pg gem against the new libpq.

类似的东西:

export PATH="/usr/pgsql-9.3/bin:$PATH"
export LD_LIBRARY_PATH="/usr/pgsql-9.3/lib/:$LD_LIBRARY_PATH"
gem uninstall pg
gem install pg

如果您希望此操作在全球范围内生效,则可以修改 /etc/ld.so.conf 以默认设置新路径,和 / etc / environment 来适当设置 PATH

If you want this to take effect globally you can modify /etc/ld.so.conf to put the new path in place by default, and /etc/environment to set the PATH appropriately.

否则,将前两行添加到您的〜/ .bash_profile 中。

Otherwise, add the first two lines to your ~/.bash_profile.

另外,这些让您非常担心:

Separately, these are rather worrying:

/etc/rc.d/init.d/functions: fork: Cannot allocate memory
/etc/profile.d/lang.sh: line 53: /sbin/consoletype: Argument list too long

as他们建议系统上有不匹配/损坏的东西。不一定与PostgreSQL有关。您是否强行安装了任何RPM或使用了任何第三方的回购协议?

as they suggest something is mismatched/broken on the system. Not necessarily PostgreSQL related. Have you force-installed any RPMs or used any 3rd party repos?

这篇关于Centos 5,rails,bundle上的Postgresql 9.2-PostgreSQL太旧了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆