Skip to content
Latchkey

What Is Gemfile?

Gemfile explained, including what it does and how it matters in CI/CD.

A Gemfile declares the gem dependencies of a Ruby project, read by Bundler.

What it is

It lists gems and version constraints. Bundler resolves them and writes the exact versions to Gemfile.lock.

Why it matters in CI/CD

CI runs bundle install and, for reproducibility, bundle install --frozen or sets BUNDLE_FROZEN, which fails if the Gemfile and lock are out of sync.

Key takeaways

  • Gemfile declares Ruby gems.
  • Bundler resolves it to Gemfile.lock.
  • Use frozen mode in CI.

Related guides

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