add fuzzy matching for head rubies, fix #1979