This rhyme and variants can be found on page 202 of Games and Songs of American Children by William Wells Newell. Published in 1883.