6

My database is on a different server to the application. When I run "bundle" I get the following error:

No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config

How do I set the pg config path if pg is not actually installed on the application server? I have also tried:

bundle config build.pg --without-pg_config

Thanks

mu is too short
  • 426,620
  • 70
  • 833
  • 800
sebastyuiop
  • 534
  • 2
  • 8
  • 16

1 Answers1

7

The Ruby PostgreSQL interface (AKA the pg gem) is just a thin wrapper around the PostgreSQL client C libraries. You need to install the PostgreSQL client libraries and headers or you can't install the pg gem. You don't need a whole PostgreSQL installation on your app server, just the client development libraries, the package is probably called something like "libpg-dev" or "libpq-dev".

mu is too short
  • 426,620
  • 70
  • 833
  • 800
  • Thanks. I now have a new problem relating to this so wondered if you could advise. The error I now get is No such file or directory. Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? Do I have to have had the PG server running on the app server for these files to exist? Thanks – sebastyuiop Sep 24 '12 at 02:50
  • 1
    @sebastyuiop: Sounds like you're trying to connect to a PostgreSQL server on localhost rather than the remote host. Check your connection set up. – mu is too short Sep 24 '12 at 03:25
  • Thanks again, I'm using Rails and I had specified a hostname parameter but it should have been host. All working now :) – sebastyuiop Sep 24 '12 at 04:42