ruby/rubygems · error · Bundler::ProductionError

The #{flag} requires a lockfile. Please make sure you have c

Error message

The #{flag} requires a lockfile. Please make sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control before deploying.

What it means

Error "The #{flag} requires a lockfile. Please make sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control before deploying." thrown in ruby/rubygems.

Source

Thrown at lib/bundler/cli/install.rb:32

      if options[:local]
        Bundler.self_manager.restart_with_locked_bundler_if_needed
      else
        Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed
      end

      Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Gem.freebsd_platform?

      if target_rbconfig_path = options[:"target-rbconfig"]
        Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)
      end

      check_trust_policy

      if Bundler.frozen_bundle? && !Bundler.default_lockfile.exist?
        flag = "deployment setting" if Bundler.settings[:deployment]
        flag = "frozen setting" if Bundler.settings[:frozen]
        raise ProductionError, "The #{flag} requires a lockfile. Please make " \
                               "sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \
                               "before deploying."
      end

      normalize_settings

      Bundler::Fetcher.disable_endpoint = options["full-index"]

      Plugin.gemfile_install(Bundler.default_gemfile, Bundler.default_lockfile) if Bundler.settings[:plugins]

      # For install we want to enable strict validation
      # (rather than some optimizations we perform at app runtime).
      definition = Bundler.definition(strict: true)
      definition.validate_runtime!
      definition.lockfile = options["lockfile"] if options["lockfile"]
      definition.lockfile = false if options["no-lock"]

      installer = Installer.install(Bundler.root, definition, options)

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/cli/install.rb:32 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/e52b1d1749e5a8e1. Report an issue: GitHub.