Skip to content

GDK install fails while installing pg gem

On Mac OS, when running gdk install the installation fails while installing pg gem.

GDK version: GitLab Development Kit gem version 0.2.4

Latest commit of gitlab-ce when running install command: https://gitlab.com/gitlab-org/gitlab-ce/commit/19d7a64a47ccbd1c10abd96de2698cc7e0c72275

Error log:

Gem files will remain installed in /Users/filipefreire/.rvm/gems/ruby-2.3.6/gems/pg-0.18.4 for inspection.
Results logged to /Users/filipefreire/.rvm/gems/ruby-2.3.6/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/gem_make.out

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.

In Gemfile:
  peek-pg was resolved to 1.3.0, which depends on
    pg
make: *** [.gitlab-bundle] Error 5

When I attempt to install the gem (gem install pg -v '0.18.4') log:

Building native extensions.  This could take a while...
ERROR:  Error installing pg:
	ERROR: Failed to build gem native extension.

    current directory: /Users/filipefreire/.rvm/gems/ruby-2.3.6/gems/pg-0.18.4/ext
/Users/filipefreire/.rvm/rubies/ruby-2.3.6/bin/ruby -r ./siteconf20180112-70546-5mdnwl.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 may
need configuration options.

Related SO question: https://stackoverflow.com/questions/4827092

Solved

  1. Run: brew install postgresql

  2. Run: gem install pg -v '0.18.4'

Maybe we should change the prepare doc to mention the installation of postgresql (without a specific version) via brew.