Ruby Gem Build "make: command not found" in CI
mkmf generated a Makefile for the gem’s extension, but there is no make on the runner to execute it. The build cannot proceed without the make utility, distinct from a missing compiler.
What this error means
A native gem build fails right after "creating Makefile" with "make: command not found" (or "sh: make: not found"). extconf succeeded; only the make step has nothing to run it.
creating Makefile
current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make: command not found
An error occurred while installing byebug, and Bundler cannot continue.Common causes
make not installed on a slim image
Minimal and Alpine images omit make to stay small. mkmf can still write a Makefile, but there is no make binary to run it.
Compiler present but make missing
An image may ship a compiler without the full build toolchain, so the configure step passes but the make step fails for lack of make.
How to fix it
Install the build toolchain (includes make)
# Debian/Ubuntu
apt-get update && apt-get install -y build-essential
# Alpine
apk add --no-cache build-base make
# RHEL/Fedora
dnf groupinstall -y "Development Tools"Avoid the build with a precompiled gem
If the gem ships a platform build, lock the Linux platform so no make is needed.
bundle lock --add-platform x86_64-linux
bundle installHow to prevent it
- Bake build-essential / build-base into images that compile gems.
- Prefer precompiled platform gems in CI to skip the build.
- Use full base images, not slim, when native builds are unavoidable.