New build issue after Ruby 2.4.2 rebuild

I requested a rebuild of Ruby 2.4.2 today to resolve some dependency graph issues, and after that rebuild which resolved those issues, I’m now seeing this failure in my builds that use it:

   active-oversight-api: Installing vendored gems to /hab/pkgs/finalze/active-oversight-api/0.1.2/20180619215634/app/vendor/bundle
   active-oversight-api: Generating app binstubs in /hab/pkgs/finalze/active-oversight-api/0.1.2/20180619215634/app/binstubs
   active-oversight-api: Vendoring Bundler version 1.16.2
ERROR:  Could not find a valid gem '/hab/pkgs/core/bundler/1.16.0/20180608194956/cache/bundler-1.16.2.gem' (>= 0) in any repository
   active-oversight-api: Build time: 1m35s
   active-oversight-api: Exiting on error

I’m not following why it’s looking for the 1.16.2 bundler gem in the 1.16.0 directory. I’m honestly not even totally sure this is a habitat problem. Any insights would be appreciated.

That might be an issue with our bundle package - let me see if I can reproduce this.

I think we need to bump core/bundler, one moment.

Pull request submitted https://github.com/habitat-sh/core-plans/pull/1598

Merged, built, and promoted to stable in builder. Could you try it again?

While exploring this on my own, I bumped the version of rails in our app from 5.1.4 to 5.1.6. Now when I try to build, I get this new and exciting error:

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

current directory:
/hab/cache/src/active-oversight-api-0.1.2/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.3/ext/nokogiri
/hab/pkgs/core/ruby/2.4.2/20180619210241/bin/ruby -r ./siteconf20180619-26656-v4p3vb.rb extconf.rb
--use-system-libraries
checking if the C compiler accepts -I/hab/pkgs/core/ruby/2.4.2/20180619210241/include
-I/hab/pkgs/core/libxml2/2.9.6/20180608141053/include
-I/hab/pkgs/core/libxslt/1.1.31/20180608141131/include
-I/hab/pkgs/core/postgresql/9.6.8/20180608211535/include
-I/hab/pkgs/core/curl/7.54.1/20180608142121/include
-I/hab/pkgs/finalze/imagemagick/6.9.2-10/20180619190029/include/ImageMagick-6
-I/hab/pkgs/core/file/5.32/20180608050620/include -I/hab/pkgs/core/gcc/7.3.0/20180608051919/include
-I/hab/pkgs/core/make/4.2.1/20180608100733/include -I/hab/pkgs/core/ruby/2.5.1/20180608194604/include...
yes
Building nokogiri using system libraries.
pkg-config could not be used to find libxml-2.0
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libxslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libexslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
*** 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=/hab/pkgs/core/ruby/2.4.2/20180619210241/bin/$(RUBY_BASE_NAME)
	--help
	--clean
	--use-system-libraries
	--with-zlib-dir
	--without-zlib-dir
	--with-zlib-include
	--without-zlib-include=${zlib-dir}/include
	--with-zlib-lib
	--without-zlib-lib=${zlib-dir}/lib
	--with-xml2-dir
	--without-xml2-dir
	--with-xml2-include
	--without-xml2-include=${xml2-dir}/include
	--with-xml2-lib
	--without-xml2-lib=${xml2-dir}/lib
	--with-libxml-2.0-config
	--without-libxml-2.0-config
	--with-pkg-config
	--without-pkg-config
	--with-xslt-dir
	--without-xslt-dir
	--with-xslt-include
	--without-xslt-include=${xslt-dir}/include
	--with-xslt-lib
	--without-xslt-lib=${xslt-dir}/lib
	--with-libxslt-config
	--without-libxslt-config
	--with-exslt-dir
	--without-exslt-dir
	--with-exslt-include
	--without-exslt-include=${exslt-dir}/include
	--with-exslt-lib
	--without-exslt-lib=${exslt-dir}/lib
	--with-libexslt-config
	--without-libexslt-config

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

/hab/cache/src/active-oversight-api-0.1.2/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/nokogiri-1.8.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/hab/cache/src/active-oversight-api-0.1.2/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.3 for inspection.
Results logged to
/hab/cache/src/active-oversight-api-0.1.2/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/nokogiri-1.8.3/gem_make.out

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

In Gemfile:
  zipline was resolved to 1.0.0, which depends on
    rails was resolved to 5.1.6, which depends on
      actioncable was resolved to 5.1.6, which depends on
        actionpack was resolved to 5.1.6, which depends on
          actionview was resolved to 5.1.6, which depends on
            rails-dom-testing was resolved to 2.0.3, which depends on
              nokogiri
   active-oversight-api: Restoring original bundler config
ERROR: bundler returned an error

Which makes me think there may be some other mismatch between the nokogiri package and the rebuilt ruby 2.4.2 as well? Again not sure. This is an simple change to revert if it’s a distraction

oops, I will revert the 5.1.6 rails upgrade and try building again

1 Like

Yep, let’s try reverting that change first, then address the “Failed to build gem native extension” error if needed :slight_smile:

yeah, your bundler bump fixed the build. I’ll start a new thread for the rails upgrade issue.

Super glad to hear that!