Test code (run from the Documents directory of a standard OS X user account).
d = Dir.new('Pictures')
pn = Pathname.new(d)
dir = pn.children.find { |child| child.directory? && child.basename.to_s == 'GoPro' }
puts dir.inspect
JRuby 1.7.5 result:
‼ ⚡ ruby dir_test.rb
TypeError: can't convert Dir into String
initialize at org/jruby/ext/pathname/RubyPathname.java:201
(root) at dir_test.rb:7
MRI 1.9.3-p392 result:
✔ ⚡ ruby dir_test.rb
#<Pathname:Pictures/GoPro>
Work-around:
pn = Pathname.new(d.path)