macOS runner: "No such file or directory @ rb_sysopen" (Ruby/gem) in CI
Ruby raised Errno::ENOENT from rb_sysopen, meaning a file open failed because the path is missing. In CI this is usually a path that exists locally but not on the runner: a config, a vendored asset, or a tool a gem expects.
What this error means
A Ruby tool (Fastlane, CocoaPods, a Rake task) fails with "No such file or directory @ rb_sysopen - <path> (Errno::ENOENT)".
/Library/Ruby/Gems/.../lib/foo.rb:12:in `read': No such file or directory @ rb_sysopen -
/Users/runner/work/app/config/secret.json (Errno::ENOENT)Common causes
A file present locally is absent in CI
An untracked config, a gitignored secret, or a generated file that is not produced in CI leaves the path missing when the gem opens it.
A relative path resolves from the wrong directory
The step runs from a different working directory than expected, so a relative open targets a path that does not exist.
How to fix it
Provide the missing file or generate it
- Read the exact path in the rb_sysopen message.
- Write the file from a secret, or run the step that generates it, before the failing command.
- Re-run the Ruby tool.
mkdir -p config
printf '%s' "$SECRET_JSON" > config/secret.jsonRun from the correct working directory
Set the step working directory so relative paths resolve to files that actually exist in the checkout.
defaults:
run:
working-directory: ./appHow to prevent it
- Materialize required config and secret files before Ruby steps.
- Use absolute or workspace-rooted paths in CI scripts.
- Set the working directory so relative opens resolve correctly.