After upgrade postgresql 8.1 to 9.0 ive noticed issues with libraries dependency. Postgresql works fine (connection, queries).
yum list postgresql*
Installed
On Mac OSX 10.6.8, using the MacPorts install of Postgres 9, the following command worked for me:
gem install pg -- --with-pgsql-lib=/opt/local/lib/postgresql90/lib --with-pg-config=/opt/local/lib/postgresql90/bin/pg_config
This seems like a pg config file location error,
gem install pg -- --with-pgsql-lib=/usr/pgsql-9.0/lib --with-pg-config=/usr/pgsql-9.1/bin/pg_config
solves it!!
gem install pg -- --with-pgsql-lib=/usr/pgsql-9.0/lib --with-pg-config=/usr/pgsql-9.1/bin/pg_config
/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Building native extensions. This could take a while...
Successfully installed pg-0.14.0
1 gem installed
Installing ri documentation for pg-0.14.0...
Installing RDoc documentation for pg-0.14.0...
libpq.so.4 is from an older version of PostgreSQL; 9.0 ships with /usr/pgsql-9.0/lib/libpq.so.5
If you have a program that was built against libpq.so.4, that file is provided by the compat-postgresql-libs packages, which you may not have installed. A lot of people remove it using "--force" because it can be hard to get the newer RPMs installed otherwise; that's a bad idea, but the alternative is complicated. If you've installed that package, you should find a /usr/lib/libpq.so.4 available that makes your existing program, compiled originally for the older PostgreSQL, happy.
$ gem --version 1.3.7 $ ruby --version ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] $ cat /etc/redhat-release CentOS release 5.4 (Final) $ uname -m x86_64 sudo yum list installed | grep postgre (see what you have installed) sudo yum list available | grep postgre (I was missing postgresql-devel) sudo yum install postgresql-devel (I installed it) sudo gem install pg (no error this time!) $ gem list --local | grep pg pg (0.11.0)
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