fix invalid map.with_index when old ruby version
escape single quote