"gumming" something was a reference to chewing on something, popularly it used to be a reference to toothless old hillbilly men arguing with each other. Today it's used as a term of disgust, along the line as, "oh, for Pete's Sake!", or, "For crying out loud!". It's proper use is more along the lines of, "shut up!" as in, "go chew on something to keep your mouth busy so you're not bothering me."
"Dad gum it and leave me alone." (Dad-gummit, leave me alone!)