{"record":{"id":"3d75582391834fe8","repo":"ruby/rubygems","slug":"cleaning-all-the-gems-on-your-system-is-dangerous","errorCode":null,"errorMessage":"Cleaning all the gems on your system is dangerous! If you're sure you want to remove every system gem not in this bundle, run `bundle clean --force`.","messagePattern":"Cleaning all the gems on your system is dangerous! If you're sure you want to remove every system gem not in this bundle, run `bundle clean --force`\\.","errorType":"exception","errorClass":"Bundler::InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/clean.rb","lineNumber":20,"sourceCode":"\nmodule Bundler\n  class CLI::Clean\n    attr_reader :options\n\n    def initialize(options)\n      @options = options\n    end\n\n    def run\n      require_path_or_force unless options[:\"dry-run\"]\n      Bundler.load.clean(options[:\"dry-run\"])\n    end\n\n    protected\n\n    def require_path_or_force\n      return unless Bundler.use_system_gems? && !options[:force]\n      raise InvalidOption, \"Cleaning all the gems on your system is dangerous! \" \\\n        \"If you're sure you want to remove every system gem not in this \" \\\n        \"bundle, run `bundle clean --force`.\"\n    end\n  end\nend\n","sourceCodeStart":2,"sourceCodeEnd":26,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/cli/clean.rb#L2-L26","documentation":"Error \"Cleaning all the gems on your system is dangerous! If you're sure you want to remove every system gem not in this bundle, run `bundle clean --force`.\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/cli/clean.rb:20 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"}