pg_config, ruby​​ pg, postgresql 9.0 升级后的问题, centos 5 [英] pg_config, ruby pg, postgresql 9.0 problem after upgrade, centos 5

查看:31
本文介绍了pg_config, ruby​​ pg, postgresql 9.0 升级后的问题, centos 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将 postgresql 8.1 升级到 9.0 后,我注意到库依赖问题.Postgresql 工作正常(连接、查询).

After upgrade postgresql 8.1 to 9.0 ive noticed issues with libraries dependency. Postgresql works fine (connection, queries).

yum list postgresql*
Installed Packages
postgresql.i386 9.0.0-1PGDG.el5 installed
postgresql-debuginfo.i386 9.0.0-1PGDG.el5 installed
postgresql-devel.i386 9.0.0-1PGDG.el5 installed
postgresql-libs.i386 9.0.0-1PGDG.el5 installed
postgresql-odbcng.i386 0.90.101-2.el5 installed
postgresql-plruby.i386 0.5.1-5.el5 installed
postgresql-server.i386 9.0.0-1PGDG.el5 install

但是当我尝试为 ruby​​ 安装pg"时,我收到了

but when im trying to install 'pg' for ruby, ive received

gem install pg
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... no
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.

当尝试使用另一个 ruby​​-postgres 驱动程序时,我得到了

When trying with another ruby-postgres driver, ive got

yum install ruby-postgres
ruby-postgres-0.7.1-5.el5.i386 from epel has depsolving problems
  --> Missing Dependency: libpq.so.4 is needed by package ruby-postgres-0.7.1-5.el5.i386 (epel)

locate libpq.so.4
/usr/lib/libpq.so.4
/usr/lib/libpq.so.4.1

也导出路径

LD_LIBRARY_PATH=/usr/pgsql-9.0/lib
export LD_LIBRARY_PATH

在使用require pg"运行 ruby​​ 脚本后(适用于 8.1),我得到了:

after running ruby script with "require pg" (works on 8.1), ive got:

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/pg_ext.so: libpq.so.4: cannot open shared object file: No such file or directory - /usr/local/lib/ruby/site_ruby/1.8/i686-linux/pg_ext.so (LoadError)
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/pg.rb:12
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'

有什么建议可以做更多吗?

Any suggestions what to do more?

推荐答案

您可以添加各种配置选项到 gem install 中,例如 -with-opt-dir, --with-pg-dir--with-pg-config.看看这个邮件列表线程:

There are various config options you can add to the gem install, like -with-opt-dir, --with-pg-dir and --with-pg-config. Look at this mailing list thread:

http://www.ruby-forum.com/topic/409608

这篇关于pg_config, ruby​​ pg, postgresql 9.0 升级后的问题, centos 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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