ruby/rubygems · error · Gem::SafeMarshal::Reader::NotImplementedError

Reading Marshal objects of type class_or_module is not imple

Error message

Reading Marshal objects of type class_or_module is not implemented

What it means

Error "Reading Marshal objects of type class_or_module is not implemented" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/safe_marshal/reader.rb:282

        sign = read_byte
        data = read_bytes(read_integer * 2)
        Elements::Bignum.new(sign, data)
      end

      def read_extended_object
        raise NotImplementedError, "Reading Marshal objects of type extended_object is not implemented"
      end

      def read_class
        raise NotImplementedError, "Reading Marshal objects of type class is not implemented"
      end

      def read_module
        raise NotImplementedError, "Reading Marshal objects of type module is not implemented"
      end

      def read_class_or_module
        raise NotImplementedError, "Reading Marshal objects of type class_or_module is not implemented"
      end

      def read_data
        raise NotImplementedError, "Reading Marshal objects of type data is not implemented"
      end

      def read_regexp
        raise NotImplementedError, "Reading Marshal objects of type regexp is not implemented"
      end

      def read_struct
        raise NotImplementedError, "Reading Marshal objects of type struct is not implemented"
      end

      def read_user_class
        name = read_element
        wrapped_object = read_element
        Elements::UserClass.new(name, wrapped_object)

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. The gem metadata uses a Marshal construct RubyGems does not support; rebuild the gem with a current RubyGems

When it happens

Trigger: Thrown at lib/rubygems/safe_marshal/reader.rb:282 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/e62550c37e4acb0b. Report an issue: GitHub.