I'm on a Mac building an app in Rails 3 with PostgreSQL...
PostgreSQL is working fine but in the command line I get the following error:
$ pg_config
-bash: pg_config: command not found
Anyone know how to get this setup so I can run pg_config?
Thanks
The view pg_config describes the compile-time configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries.
Open the postgresql. conf configuration file. This file is located at %postgresql_dir%\data . Here %postgresql_dir% (for example, C:\Program Files\PostgreSQL\11 ) is the folder that PostgreSQL was installed in.
In addition to installing postgresql-devel
I had to modify the PATH
environment variable. E.g. add this to your .bashrc
:
export PATH="$PATH:/usr/pgsql-9.4/bin"
you can install postgresql-devel to get that. in rpm based distro
yum install postgresql-devel
will work
or use
yum provides "*/pg_config"
to get the exact package
My problem was that pg_config
was not in the PATH. So, I first needed to search for pg_config
's path by using
yum provides "*/pg_config"
After noting the path, I used this command to install pg gem
gem install pg -- --with-pg-config=/usr/pgsql-9.4/bin/pg_config
That installed pg
successfully. The system was a CentOS.
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