Install ruby ‘pg’ library problems

After I’ve installed postgresql, the problem with ‘pg’ library persisted


sudo gem install pg -v '0.11.0'
.....
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.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

The solution for this is to run the installer in this way:


sudo env ARCHFLAGS="-arch x86_64" gem install pg

Leave a Reply

Your email address will not be published. Required fields are marked *