CircleCI-Public / cimg-ruby

The CircleCI Ruby Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/ruby
MIT License
33 stars 39 forks source link

Image doesn't have libpq installed anymore? #35

Closed louim closed 4 years ago

louim commented 4 years ago

Hey!

I tried switching from circleci/ruby:2.6-node to cimg/ruby:2.6-node, but now my build fail because libpq is not installed by default anymore? Is this supposed to be the case or is it an oversight? This is a rails app with Postgresql at the database, and the pg gem fails to install. Log excerpt from the install:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/circleci/project/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/ext
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.6.0 -r
./siteconf20200406-136-3fc85q.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.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
    --with-pg
    --without-pg
    --enable-windows-cross
    --disable-windows-cross
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/home/circleci/project/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/pg-1.2.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/home/circleci/project/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3 for inspection.
Results logged to
/home/circleci/project/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/pg-1.2.3/gem_make.out

An error occurred while installing pg (1.2.3), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.2.3' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  pg

Exited with code exit status 5
FelicianoTech commented 4 years ago

This is intentional but hasn't had much discussion either. I opened an issue on this in another repo for feedback: https://github.com/CircleCI-Public/cimg-base/issues/60

FelicianoTech commented 4 years ago

@louim libpq-dev is now installed in this image. Available in the tags: 2.5.8, 2.5, 2.6.6, 2.6, 2.7.1, 2.7 and any releases from today on out.

FelicianoTech commented 4 years ago

Oh and the node-variant tags for these ^ as well.

louim commented 4 years ago

Thanks, I'll give it a try!

FelicianoTech commented 4 years ago

Actually, they'll need a few more minutes. They are still building.