ruby/rubygems · error · Gem::Package::FormatError
package content (data.tar.gz) is missing
Error message
package content (data.tar.gz) is missing
What it means
Error "package content (data.tar.gz) is missing" thrown in ruby/rubygems.
Source
Thrown at lib/rubygems/package.rb:729
rescue StandardError
warn "Exception while verifying #{@gem.path}"
raise
end
##
# Verifies the files of the +gem+
def verify_files(gem)
gem.each do |entry|
verify_entry entry
end
unless @spec
raise Gem::Package::FormatError.new "package metadata is missing", @gem
end
unless @files.include? "data.tar.gz"
raise Gem::Package::FormatError.new \
"package content (data.tar.gz) is missing", @gem
end
if (duplicates = @files.group_by {|f| f }.select {|_k,v| v.size > 1 }.map(&:first)) && duplicates.any?
raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(", ")})"
end
end
if RUBY_ENGINE == "truffleruby"
def copy_stream(src, dst, size) # :nodoc:
dst.write src.read(size)
end
else
def copy_stream(src, dst, size) # :nodoc:
IO.copy_stream(src, dst, size)
end
end
View on GitHub (pinned to 86cbb817a3)
Solutions
- Rebuild the gem so it contains data.tar.gz
- Re-download the gem from the source if it was truncated
When it happens
Trigger: Thrown at lib/rubygems/package.rb:729 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23).
Data as JSON: /api/errors/8e66c68aa3071929.
Report an issue: GitHub.