pg_config,ruby pg,升级后的postgresql 9.0问题,centos 5 [英] pg_config, ruby pg, postgresql 9.0 problem after upgrade, centos 5
问题描述
yum列表postgresql *
安装的软件包
postgresql.i386 9.0.0-1PGDG.el5已安装
postgresql-debuginfo.i386 9.0.0-1PGDG.el5已安装
postgresql-devel.i386 9.0.0-1PGDG.el5已安装
postgresql-libs。 i386 9.0.0-1PGDG.el5已安装
postgresql-odbcng.i386 0.90.101-2.el5已安装
postgresql-plruby.i386已安装0.5.1-5.el5
postgresql-server .i386 9.0.0-1PGDG.el5安装
但是当我尝试安装'pg'for ruby ,ive收到
gem install pg
构建本机扩展。这可能需要一段时间...
错误:安装pg时出错:
错误:无法构建gem本机扩展。
/ usr / local / bin / ruby extconf.rb
检查pg_config ... no
检查libpq-fe.h ... no
Can '找不到'libpq-fe.h头文件
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。
当尝试使用另一个ruby-postgres驱动程序时,我得到了
yum install ruby-postgres
epel的ruby-postgres-0.7.1-5.el5.i386解决了问题
- >缺少相关性:package需要libpq.so.4 ruby-postgres-0.7.1-5.el5.i386(epel)
和
locate libpq.so.4
/usr/lib/libpq.so .4
/usr/lib/libpq.so.4.1
也输出路径 p>
LD_LIBRARY_PATH = / usr / pgsql-9.0 / lib
export LD_LIBRARY_PATH
在使用require pg(适用于8.1)运行ruby脚本之后,我得到了:
/usr/local/lib/ruby/site_ruby/1.8/i686-linux/pg_ext.so:libpq.so.4:无法打开共享对象文件:没有这样的文件或目录 - / usr /local/lib/ruby/site_ruby/1.8/i686-linux/pg_ext.so(LoadError)/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:在/ usr / local / lib / ruby / s的`gem_original_require'
中ite_ruby / 1.8 / rubygems / custom_require.rb:29:在`require'
任何建议做什么更多?
您可以将各种配置选项添加到gem install中,如
-with- opt-dir
, - with-pg-dir
和 - with-pg-config
。看看这个邮件列表的主题: http:// www。 ruby-forum.com/topic/409608
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
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.
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)
and
locate libpq.so.4
/usr/lib/libpq.so.4
/usr/lib/libpq.so.4.1
also exported path
LD_LIBRARY_PATH=/usr/pgsql-9.0/lib
export LD_LIBRARY_PATH
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?
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屋!