I just installed a fresh copy of Ruby 1.9 and Rails 3 on a Debian Squeeze server. The Rails web application will need to connect to a remote Postgres database so I tried to install the Postgres adapter but it appears that the installer is looking for a local PostgreSQL database and and configs that aren’t there because the Postgres database lives on a different host.
Can someone explain how to install the Postgres adapter when the actual Postgres database lives on a different machine?
Thanks
gem1.9.1 install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
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.
There are missing libraries on your environment. Try to install all of them before you try to install the
pggem.Alternatively, if the libs are all installed and you are still getting the same error, try installing the gem specifying the postgres config file with the
--with-pg-configcommand your error is showing above.