{"record":{"id":"1aa0c60585524cde","repo":"ruby/rubygems","slug":"removing-all-platforms-from-the-bundle-is-not-allo","errorCode":null,"errorMessage":"Removing all platforms from the bundle is not allowed","messagePattern":"Removing all platforms from the bundle is not allowed","errorType":"exception","errorClass":"InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/lock.rb","lineNumber":65,"sourceCode":"\n        Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]\n\n        options[\"remove-platform\"].flatten.each do |platform_string|\n          platform = Gem::Platform.new(platform_string)\n          definition.remove_platform(platform)\n        end\n\n        options[\"add-platform\"].flatten.each do |platform_string|\n          platform = Gem::Platform.new(platform_string)\n          if platform.to_s == \"unknown\"\n            Bundler.ui.error \"The platform `#{platform_string}` is unknown to RubyGems and can't be added to the lockfile.\"\n            exit 1\n          end\n          definition.add_platform(platform)\n        end\n\n        if definition.platforms.empty?\n          raise InvalidOption, \"Removing all platforms from the bundle is not allowed\"\n        end\n\n        definition.remotely! unless options[:local]\n\n        if options[\"normalize-platforms\"]\n          definition.normalize_platforms\n        end\n\n        if print\n          puts definition.to_lock\n        else\n          file = options[:lockfile]\n          file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile\n\n          puts \"Writing lockfile to #{file}\"\n          definition.write_lock(file, false)\n        end\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/cli/lock.rb#L47-L83","documentation":"Error \"Removing all platforms from the bundle is not allowed\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/cli/lock.rb:65 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"}