PostgreSQL - pg_config -bash: pg_config: command not found
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
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"
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.