Netlify Ruby-based build fails with "You have to install development tools first." when building a native gem

  • We need to know your netlify site name.
    • xenodochial-feynman-1c9012
  • Build problems? Link or paste the FULL build log & build settings screenshot

Hi all,

I’ve used Netlify previews and deploys for my personal blog for sometime, though it had gone stale recently.

on Nov 5, I succeeded in a deployment where I changed the Ruby version from 3.3.4 to 3.3.6. This was to remain in line with GitHub Pages v232 release. Build log: Netlify

I am able to build and serve the site with Jekyll just fine from a devcontainer or from GitHub Pages, but the Netlify build fails.

An example of a failed build, which fails during initialization, is here: Netlify

The error appears to be that when attempting to build native gem extensions, Ruby fails because the ruby dev tools are not installed. I assume this would be a default install for the Netlify platform, but maybe something has changed with the build images?

Sample from the logs:

5:52:00 PM: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
5:52:00 PM: current directory:
5:52:00 PM: /opt/build/cache/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal
5:52:00 PM: /opt/buildhome/.rvm/rubies/ruby-3.3.4/bin/ruby extconf.rb
5:52:00 PM: checking for __builtin_clz()... *** extconf.rb failed ***
5:52:00 PM: Could not create Makefile due to some reason, probably lack of necessary
5:52:00 PM: libraries and/or headers.  Check the mkmf.log file for more details.  You may
5:52:00 PM: need configuration options.
5:52:00 PM: Provided configuration options:
5:52:00 PM: 	--with-opt-dir
5:52:00 PM: 	--without-opt-dir
5:52:00 PM: 	--with-opt-include=${opt-dir}/include
5:52:00 PM: 	--without-opt-include
5:52:00 PM: 	--with-opt-lib=${opt-dir}/lib
5:52:00 PM: 	--without-opt-lib
5:52:00 PM: 	--with-make-prog
5:52:00 PM: 	--without-make-prog
5:52:00 PM: 	--srcdir=.
5:52:00 PM: 	--curdir
5:52:00 PM: 	--ruby=/opt/buildhome/.rvm/rubies/ruby-3.3.4/bin/$(RUBY_BASE_NAME)
5:52:00 PM: /opt/buildhome/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/mkmf.rb:480:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Full source can be found at GitHub - SeanKilleen/seankilleen.github.io: The blog reboot.

Nevermind, this was entirely on me. I hadn’t merged a branch apparently, and so the ruby versions were off.

Sorry for the false alarm! This is completely resolved.

2 Likes

I had a similar problem to what was shown here and found this through Google.

The bigdecimal library wouldn’t install (dependency of activesupport) and notice the ruby version of 3.3.4 which is what was failing for me (as specified in my .ruby-version file).

Changing that to 3.3.6 cleared up the problem, 3.3.6 is what I was using locally.