Skip to content
Latchkey

Bundler "No such file or directory - <tool>" Spawning a Binary in CI

A bundled gem tried to spawn an external command and the OS could not find it. The Ruby side is fine - a system binary the gem shells out to (git, node, a compiler, an image tool) is not installed or not on PATH on the runner.

What this error means

A task fails with Errno::ENOENT "No such file or directory - <tool>", where <tool> is an external binary (not a Ruby file). The gem runs until it tries to exec the missing system command.

Ruby traceback
Errno::ENOENT: No such file or directory - git
  from .../gem/lib/.../repo.rb:44:in `spawn'

Common causes

A required system binary is not installed

The gem shells out to an external tool (git, node, ffmpeg, imagemagick, a compiler) that is absent on a slim runner image, so the spawn fails with ENOENT.

The binary exists but is not on PATH

The tool is installed in a non-standard location not on the PATH visible to the bundled process, so the OS cannot find it.

How to fix it

Install the missing system tool

Read the tool named in the ENOENT message and install it.

Terminal
# example: the gem shells out to git
apt-get update && apt-get install -y git
# verify it is found
which git

Put the binary on PATH

  1. If the tool is installed elsewhere, add its directory to PATH for the job.
  2. In GitHub Actions, echo the path to $GITHUB_PATH so later steps see it.
  3. Confirm with which <tool> in the same step that runs the gem.

How to prevent it

  • Bake the system tools your gems shell out to into the runner image.
  • Confirm external binaries are on PATH in the step that invokes them.
  • Document a gem’s system dependencies so they are provisioned in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →