ruby/rubygems · error · Gem::SafeMarshal::Visitors::ToRuby::MethodCallError

Unable to call #{method.inspect} on #{receiver.inspect}, per

Error message

Unable to call #{method.inspect} on #{receiver.inspect}, perhaps it is a class using marshal compat, which is not visible in ruby? #{e}

What it means

Error "Unable to call #{method.inspect} on #{receiver.inspect}, perhaps it is a class using marshal compat, which is not visible in ruby? #{e}" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/safe_marshal/visitors/to_ruby.rb:369

          when Elements::SymbolLink
            visit_Gem_SafeMarshal_Elements_SymbolLink(element).to_s
          else
            raise FormatError, "Expected symbol or symbol link, got #{element.inspect} @ #{formatted_stack.join(".")}"
          end
        end
      end

      def register_object(o)
        @objects << o
        o
      end

      def call_method(receiver, method, *args)
        receiver.__send__(method, *args)
      rescue NoMethodError => e
        raise unless e.receiver == receiver

        raise MethodCallError, "Unable to call #{method.inspect} on #{receiver.inspect}, perhaps it is a class using marshal compat, which is not visible in ruby? #{e}"
      end

      def formatted_stack
        formatted = []
        @stack[0, @stack_idx].each do |e|
          if e.is_a?(Integer)
            if formatted.last == "ivar_"
              formatted[-1] = "ivar_#{e}"
            else
              formatted << "[#{e}]"
            end
          else
            formatted << e
          end
        end
        formatted
      end

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. The metadata uses marshal compat on an invisible class; rebuild the gem with a current RubyGems

When it happens

Trigger: Thrown at lib/rubygems/safe_marshal/visitors/to_ruby.rb:369 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/0ba45f7a14479b11. Report an issue: GitHub.