1

I'm learning to use ruby on rails on windows 8.1. I got stuck when I had to install pg(postgres) gem. To be specific, this is the error:

Error: Error installing pg:

   Error: failed to build gem natve extension
   C:/Rails Installer/Ruby2.1.0/bin/ruby.exe extconf.rb
  checking for pg_config... no
No pg_confg... trying anyway. If build 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.

I'm stuck, any suggestion will help. Thanks

Mackles24
  • 111
  • 1
  • 8

1 Answers1

0

Try to identify where the pg_config is located using the Windows command-line tool (source: https://superuser.com/questions/49104/how-do-i-find-the-location-of-an-executable-in-windows):

where pg_config

Copy the path returned and use it

bundle config build.pg --with-pg-config=/path/found/for/pg_config

(based on ERROR: Failed to build gem native extension on Mavericks)

Community
  • 1
  • 1
MrYoshiji
  • 54,334
  • 13
  • 124
  • 117