{"record":{"id":"971b7e1807ac1428","repo":"ruby/rubygems","slug":"error-reading-files-from-gem","errorCode":null,"errorMessage":"Error reading files from gem","messagePattern":"Error reading files from gem","errorType":"exception","errorClass":"Gem::Exception","httpStatus":null,"severity":"error","filePath":"lib/rubygems/package/old.rb","lineNumber":60,"sourceCode":"      read_until_dashes io # spec\n      header = file_list io\n\n      @contents = header.map {|file| file[\"path\"] }\n    end\n  end\n\n  ##\n  # Extracts the files in this package into +destination_dir+\n\n  def extract_files(destination_dir)\n    verify\n\n    errstr = \"Error reading files from gem\"\n\n    @gem.with_read_io do |io|\n      read_until_dashes io # spec\n      header = file_list io\n      raise Gem::Exception, errstr unless header\n\n      # install_location expects an already-resolved destination dir\n      destination_dir = File.realpath(destination_dir)\n\n      header.each do |entry|\n        full_name = entry[\"path\"]\n\n        destination = install_location full_name, destination_dir\n\n        file_data = String.new\n\n        read_until_dashes io do |line|\n          file_data << line\n        end\n\n        file_data = file_data.strip.unpack1(\"m\")\n        file_data = Zlib::Inflate.inflate file_data\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/package/old.rb#L42-L78","documentation":"Error \"Error reading files from gem\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/package/old.rb:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-download the gem; its file table could not be read","Rebuild the gem if you created it"],"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"}