You’re trying to redefine a class (through multiple but different
most likely) with different subclasses. Try this out:
class Tester < Parent1
class Tester < Parent2
require ‘file2’ # => Superclass Mismatch for Tester file2.rb
This error is slightly cryptic but does make sense when you know what it
means. The error is named as such because of the open classes nature of
Ruby. Were the superclasses the same, then it’d be simply adding
functionality to an existing class. However, as the classes are of
types, Ruby can’t know what to do with them and thus dies.
So make sure you’re not trying to munge up the Object namespace with
named the same but are different types.
I’m not sure of the exact reason as to why ApplicationController fails
ActionController::Base works, but do remember that Rails does a lot of
strange things to the ObjectSpace.