1

I have been trying to install pg to run my web application (Ruby on Rails).

I use a pg database.

With bundle install, it fails.

The output is:

current directory: /home/pi/.rvm/gems/ruby-2.3.3/gems/pg-0.18.4/ext
/home/pi/.rvm/rubies/ruby-2.3.3/bin/ruby -r
./siteconf20161225-10359-1iu9cfy.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 ***
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 mayneed configuration options.

And

An error occurred while installing pg (0.18.4), and Bundler cannot
continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.

What is the way to fix it?

techraf
  • 4,353
  • 10
  • 32
  • 43
Greek2015
  • 11
  • 1

1 Answers1

1

I expect installing the PostgreSQL libraries is a requirement:

sudo apt-get install libpq-dev
Roy
  • 111
  • 4