May be Richard Dale has a solution for this?

"class << file" changes Dirs' ancestors  by Qt.

-----------------------------------------------------------------------
[spatel@taamportable test]$ cat x.rb
class << File
    p 'Dir ancetors: '
    p Dir.ancestors
 end

require "Qt"

class << File
    p 'Dir ancetors after import Qt: '
    p Dir.ancestors
end

--------------------------------------------------------------

[spatel@taamportable test]$ ruby x.rb
"Dir ancetors: "
[Dir, Enumerable, Object, Kernel]
"Dir ancetors after import Qt: "
[Qt::Dir, Qt::Base, Object, PP::ObjectMixin, Kernel]
[spatel@taamportable test]$