Workaround for segmentation fault when calling Dir.glob method