{"record":{"id":"6b6c4ee29a75e439","repo":"ruby/ruby","slug":"you-are-trying-to-check-outdated-gems-in-deploymen","errorCode":null,"errorMessage":"You are trying to check outdated gems in deployment mode. Run `bundle outdated` elsewhere.\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} freeze\nby running `#{suggested_command}`.","messagePattern":"You are trying to check outdated gems in deployment mode\\. Run `bundle outdated` elsewhere\\.\n\nIf this is a development machine, remove the #(.+?) freeze\nby running `#(.+?)`\\.","errorType":"exception","errorClass":"ProductionError","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/outdated.rb","lineNumber":261,"sourceCode":"    end\n\n    def cooldown_days_remaining(spec, now = Time.now)\n      return nil unless spec.respond_to?(:created_at) && spec.created_at\n      return nil unless spec.respond_to?(:remote) && spec.remote\n      days = spec.remote.effective_cooldown\n      return nil if days.nil? || days <= 0\n      remaining = days - ((now - spec.created_at) / 86_400.0)\n      remaining > 0 ? remaining.ceil : nil\n    end\n\n    def check_for_deployment_mode!\n      return unless Bundler.frozen_bundle?\n      suggested_command = if Bundler.settings.locations(\"frozen\").keys.&([:global, :local]).any?\n        \"bundle config unset frozen\"\n      elsif Bundler.settings.locations(\"deployment\").keys.&([:global, :local]).any?\n        \"bundle config unset deployment\"\n      end\n      raise ProductionError, \"You are trying to check outdated gems in \" \\\n        \"deployment mode. Run `bundle outdated` elsewhere.\\n\" \\\n        \"\\nIf this is a development machine, remove the \" \\\n        \"#{Bundler.default_gemfile} freeze\" \\\n        \"\\nby running `#{suggested_command}`.\"\n    end\n\n    def update_present_via_semver_portions(current_spec, active_spec, options)\n      current_major = current_spec.version.segments.first\n      active_major = active_spec.version.segments.first\n\n      update_present = false\n      update_present = active_major > current_major if options[\"filter-major\"]\n\n      if !update_present && (options[\"filter-minor\"] || options[\"filter-patch\"]) && current_major == active_major\n        current_minor = get_version_semver_portion_value(current_spec, 1)\n        active_minor = get_version_semver_portion_value(active_spec, 1)\n\n        update_present = active_minor > current_minor if options[\"filter-minor\"]","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/ruby/ruby/blob/0e5b888e1c355f3f728f2659f085820937dada48/lib/bundler/cli/outdated.rb#L243-L279","documentation":"Bundler::CLI::Outdated#check_for_deployment_mode! (lib/bundler/cli/outdated.rb:261) aborts when Bundler.frozen_bundle? is true: checking for outdated gems requires hitting remote sources and building an updated definition, which deployment mode (BUNDLE_DEPLOYMENT=true or BUNDLE_FROZEN=true) forbids. It raises Bundler::ProductionError and, when possible, computes the exact `bundle config unset` command for whichever setting caused the freeze.","triggerScenarios":"Running `bundle outdated` on a production host or in a deploy container where BUNDLE_DEPLOYMENT/BUNDLE_FROZEN is set; or on a dev machine where `bundle config set deployment true` was left behind.","commonSituations":"SSH-ing into a server to check for available updates; Docker images built with BUNDLE_FROZEN=true where operators exec bundle outdated; shared CI runners with global frozen config.","solutions":["Run `bundle outdated` on a development machine or CI job without deployment/frozen mode set","If this is a dev machine, run the command the error prints: `bundle config unset frozen` (or `bundle config unset deployment`)","Check where it comes from: `bundle config get frozen`, `bundle config get deployment`, and env vars BUNDLE_FROZEN/BUNDLE_DEPLOYMENT"],"exampleFix":"# before\n$ BUNDLE_DEPLOYMENT=true bundle outdated\n# => You are trying to check outdated gems in deployment mode...\n\n# after\n$ bundle config unset deployment\n$ bundle outdated","handlingStrategy":"validation","validationCode":"if Bundler.frozen_bundle?\n  warn 'bundle outdated is disabled in deployment/frozen mode'\n  suggested = Bundler.settings.locations('frozen').keys.intersect?(%i[global local]) ? 'bundle config unset frozen' : 'bundle config unset deployment'\n  abort \"Run `#{suggested}` on a dev machine, or check updates elsewhere\"\nend\n","typeGuard":"def outdated_allowed_here?\n  !Bundler.frozen_bundle?\nend","tryCatchPattern":"begin\n  Bundler::CLI::Outdated.new(options, gems).run\nrescue Bundler::ProductionError => e\n  warn e.message # includes the exact config unset command\n  exit 1\nend","preventionTips":["Run update checks in CI with BUNDLE_FROZEN/BUNDLE_DEPLOYMENT unset","Never exec bundle outdated inside deploy containers","Periodically audit `bundle config list` for stale deployment/frozen settings"],"tags":["bundler","outdated","deployment","frozen","production"],"backgroundTag":"frozen-bundle-restriction","analyzedSha":"0e5b888e1c355f3f728f2659f085820937dada48","analyzedAt":"2026-08-21T14:25:43.473Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}