gem install pg -v '1.2.3'
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 ***
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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/aleksejmelehov/.asdf/installs/ruby/2.7.0/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pq-dir
--without-pq-dir
--with-pq-include
--without-pq-include=${pq-dir}/include
--with-pq-lib
--without-pq-lib=${pq-dir}/lib
--with-pqlib
--without-pqlib
--with-libpq-dir
--without-libpq-dir
--with-libpq-include
--without-libpq-include=${libpq-dir}/include
--with-libpq-lib
--without-libpq-lib=${libpq-dir}/lib
--with-libpqlib
--without-libpqlib
--with-ms/libpq-dir
--without-ms/libpq-dir
--with-ms/libpq-include
--without-ms/libpq-include=${ms/libpq-dir}/include
--with-ms/libpq-lib
--without-ms/libpq-lib=${ms/libpq-dir}/lib
--with-ms/libpqlib
--without-ms/libpqlib`
sudo gem install pg -v '1.2.3' --source 'https://rubygems.org/' -- --with-pg-config=/Users/aleksejmelehov/.asdf/installs/postgres/15.3/bin/pg_config -- --with-cflags="-Wno-error=implicit-function-declaration"
Building native extensions with: '--with-pg-config=/Users/aleksejmelehov/.asdf/installs/postgres/15.3/bin/pg_config -- --with-cflags=-Wno-error=implicit-function-declaration
Asked
Active
Viewed 110 times
0

spickermann
- 100,941
- 9
- 101
- 131
-
1You'll need to install `libpq` first. The method to do this depends entirely on your operating system. In this case, can you [use Homebrew](https://formulae.brew.sh/formula/libpq)? – tadman May 11 '23 at 21:20
-
After installation, the error persisted. – Alexey Melekhov May 12 '23 at 05:38
-
The next step is you might need to specify the path if it's not in a standard location. That's what all those options are for. – tadman May 12 '23 at 14:03
-
This issue is similar to https://stackoverflow.com/questions/6209797/cant-find-the-postgresql-client-library-libpq – Biki Maharjan May 18 '23 at 17:17