Coerce path into string before attempting to generate dir contents; MacRuby has issues with paths and strings, this fixes an issue on MacRuby. Like #852 and #303.