This is because Class undefs refine, and the refinement for Module is after the lookup chain for Class. Your code works fine if you call refine on a Module and not a Class, or if you remove the undef from Class. Ruby does not support directly removing an undef through remove_method, but you can override the method and remove the overridden method. This code: