ruby/rubygems · error · Gem::SafeMarshal::Visitors::ToRuby::FormatError
Unexpected value for String :E #{v.inspect}
Error message
Unexpected value for String :E #{v.inspect} What it means
Error "Unexpected value for String :E #{v.inspect}" thrown in ruby/rubygems.
Source
Thrown at lib/rubygems/safe_marshal/visitors/to_ruby.rb:135
dumped[0, 2] = ""
marshal_string.concat(dumped)
end
object = @objects[object_offset] = Marshal.load(marshal_string)
end
when Elements::String
enc = nil
ivars.reject! do |k, v|
case k
when :E
case v
when TrueClass
enc = "UTF-8"
when FalseClass
enc = "US-ASCII"
else
raise FormatError, "Unexpected value for String :E #{v.inspect}"
end
when :encoding
enc = v
else
next false
end
true
end
object.force_encoding(enc) if enc
end
ivars.each do |k, v|
object.instance_variable_set k, v
end
object
end
View on GitHub (pinned to 86cbb817a3)
Solutions
- The metadata string encoding flag is invalid; the file is corrupt — re-download the gem
When it happens
Trigger: Thrown at lib/rubygems/safe_marshal/visitors/to_ruby.rb:135 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/55eb33bad87edb98.
Report an issue: GitHub.