Ruby "No such file or directory -- bundle (Errno::ENOENT)" in CI
A process tried to exec bundle and the OS could not find the executable on PATH. Bundler may be installed, but its shim/binstub is not on the PATH for the active Ruby - commonly a missing rbenv rehash or the wrong interpreter selected.
What this error means
A script or tool that shells out to bundle fails with Errno::ENOENT "No such file or directory -- bundle", or the shell reports "bundle: command not found". The binary is not where PATH expects it.
Errno::ENOENT: No such file or directory - bundle
from lib/tasks/deploy.rake:12:in `system'Common causes
Bundler shim not generated
Under rbenv, installing Bundler does not create its shim until rbenv rehash runs. Until then, bundle is not on the shim PATH and exec fails with ENOENT.
Wrong interpreter / PATH active
A different Ruby is active than the one Bundler was installed for, or the gem bin directory is not on PATH, so bundle cannot be located.
How to fix it
Install Bundler and rehash
gem install bundler
rbenv rehash
which bundle # confirm it resolvesConfirm interpreter and PATH
- Run ruby -v and which ruby to verify the expected Ruby is active.
- Run gem env to confirm the gem bin directory is on PATH.
- For setup-ruby, let it install Bundler so the binary is wired up automatically.
How to prevent it
- Run rbenv rehash after installing Bundler or any gem with executables.
- Keep one consistent interpreter active across all CI steps.
- Let setup-ruby install Bundler so its binary is on PATH.