In the book "Founding Rivals" by Chris Derose, he points at what could be considered the very first gerrymander.
Patrick Henry dominated the Virginia legislature and vehemently opposed the Constitution, so when it passed and the new Congressional system was enacted and districts had to be created, Henry drew a district deliberately to pit James Madison (key creator of the New Constitution) versus James Monroe, who also opposed ratification!
Madison won, but Monroe would go on to become the 5th president and the only president that actively opposed the ratification