I have:
However, pg gem fails to build, saying that:
checking for pg_config... yes
Using config values from /usr/lib/postgresql/8.4/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... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
I understant that this problem was asked dozen of times, but I googled like 2 days, and tried all the solutions I encoutered, and still this gem fails to build.
Any ideas?
Today I encountered a very similar problem on an Ubuntu 10.04. After trying to get the pg installed for half a day, I decided to just install a more recent version of postgresql manually - which solved the problem for me.
Here is what I did:
1) Obtain the postgresql sources from their website. Since I deploy my rails applications to heroku and they say that they use version 9.0 of postgresql atm, I downloaded
http://ftp.postgresql.org/pub/source/v9.0.6/postgresql-9.0.6.tar.gz
2) Unpack, then follow the instructions in the INSTALL file. Note that 'su' is to be replaced by 'sudo su' in Ubuntu. After that, you have a postgresql server installed at /usr/local/pgsql/.
3) If you already had a system user named 'postgres', you might want to change its home directory to the new postgres installation. And you might want to add /usr/local/pgsql/bin to your PATH. Maybe uninstalling the postgresql-8.4 through apt-get before installing the 9.0 version from sources would be a good idea, I did not try that.
hth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With