{"record":{"id":"e52b1d1749e5a8e1","repo":"ruby/rubygems","slug":"the-flag-requires-a-lockfile-please-make-sure","errorCode":null,"errorMessage":"The #{flag} requires a lockfile. Please make sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control before deploying.","messagePattern":"The #(.+?) requires a lockfile\\. Please make sure you have checked your #(.+?) into version control before deploying\\.","errorType":"exception","errorClass":"Bundler::ProductionError","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/install.rb","lineNumber":32,"sourceCode":"\n      if options[:local]\n        Bundler.self_manager.restart_with_locked_bundler_if_needed\n      else\n        Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed\n      end\n\n      Bundler::SharedHelpers.set_env \"RB_USER_INSTALL\", \"1\" if Gem.freebsd_platform?\n\n      if target_rbconfig_path = options[:\"target-rbconfig\"]\n        Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)\n      end\n\n      check_trust_policy\n\n      if Bundler.frozen_bundle? && !Bundler.default_lockfile.exist?\n        flag = \"deployment setting\" if Bundler.settings[:deployment]\n        flag = \"frozen setting\" if Bundler.settings[:frozen]\n        raise ProductionError, \"The #{flag} requires a lockfile. Please make \" \\\n                               \"sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control \" \\\n                               \"before deploying.\"\n      end\n\n      normalize_settings\n\n      Bundler::Fetcher.disable_endpoint = options[\"full-index\"]\n\n      Plugin.gemfile_install(Bundler.default_gemfile, Bundler.default_lockfile) if Bundler.settings[:plugins]\n\n      # For install we want to enable strict validation\n      # (rather than some optimizations we perform at app runtime).\n      definition = Bundler.definition(strict: true)\n      definition.validate_runtime!\n      definition.lockfile = options[\"lockfile\"] if options[\"lockfile\"]\n      definition.lockfile = false if options[\"no-lock\"]\n\n      installer = Installer.install(Bundler.root, definition, options)","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/cli/install.rb#L14-L50","documentation":"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.","triggerScenarios":"Thrown at lib/bundler/cli/install.rb:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}