I've reviewed all the posts on SO with similar errors installing the Postgres pg
gem.
My issue is unique: I can successfully add Postgres to my Sinatra Ruby project via the Gemfile and bundle install
-- however when building the Docker image it fails installing pg
with the following error:
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /usr/local/bundle/gems/pg-0.19.0/ext
/usr/local/bin/ruby -r ./siteconf20170113-7-ottv1k.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
I've tried everything suggested in similar answers:
- Brew install / uninstall,
- gem install / uninstall specifying path to both files:
pg_config
andlibpq-fe.h
- etc.
As I'm not too familiar with Docker, is there something I'm missing about installing a db with Docker?
Any help much much appreciated in advance. Thank you.