As the error message says, there is an opening of the Cookie class somewhere in the code that uses a different superclass than the one used in the previous definition or opening of the Cookie class.
Even a class definition that does not explicitly indicate a superclass still has a superclass:
class Cookie end
This defines the Cookie class with the superclass Object.
I met this error before, and this will happen when you have code trying to reopen a class without specifying a superclass, and the programmer’s assumption is that the class (in this case, Cookie) is already defined, and that it simply opens it, to add some features. But if reopening and defining are in reverse order, you will get this error because the class will already be defined as a subclass of the object, but is trying to redefine or reopen by another superclass. Try this in irb:
% irb irb(main):001:0> class C < String; end => nil irb(main):002:0> class C; end => nil irb(main):003:0> exit % irb irb(main):001:0> class C; end => nil irb(main):002:0> class C < String; end TypeError: superclass mismatch for class C from (irb):2
So, you probably should just use grep to define the Cookie class and try to ensure that the files are always required-d in the correct order. It may or may not be easy. :)
source share