Gemfile.lockとは?
Gemfile.lockの解説。何をするもので、CI/CDでどう重要かを含みます。
Gemfile.lockは、Bundlerが解決したすべてのgem(および推移的な依存関係)の正確なバージョンを記録します。
何であるか
インストールをマシン間で再現可能にします。アプリケーションでは常にcommitすべきです。
CI/CDで重要な理由
CIはGemfile.lockからfrozenモードでインストールするため、黙って変わることはありません。不一致のエラーは、更新されたlockをcommitすることを意味します。
重要なポイント
- Gemfile.lockはgemの正確なバージョンを固定します。
- アプリケーションでは常にcommitしましょう。
- CIはfrozenモードでそこからインストールします。
関連ガイド
What Is Gemfile?Gemfile declares Ruby gem dependencies. Learn how Bundler and CI use it.
What Is a Lockfile and Why Should You Commit It?A lockfile pins the exact versions of every dependency so builds are reproducible. Learn why committing it is…
What Is a Reproducible Build?A reproducible build produces byte-for-byte identical output from the same source, every time. Learn what bre…