"Hey, Rube!" is a slang phrase most commonly used in the United States by circus and travelling carnival workers ("carnies"), with origins in the middle 19th century. It is a rallying call, or a cry for help, used by carnies in a fight with outsiders. It is also sometimes used to refer to such a fight: "The clown got a black eye in a Hey, Rube."
In the early days of circuses in America (c. 1800–1860), it was very common for carnies to get into fights with the locals as they travelled from town to town. Circuses were rowdy, loud, and often lewd affairs, where country people could gather, blow off steam, and voice political views. Mark Twain's classic description of a circus and other shows in Adventures of Huckleberry Finn provides illustration. It was a rare show that did not include at least some violence, and this often involved the members of the circus.
When a carnie was attacked or in trouble, he would yell "Hey, Rube!" and all carnies in earshot would rush to his aid. Circus pioneer and legendary clown Dan Rice called it "a terrible cry, as no other expression in the language does, that a fierce deadly fight is on, that men who are far away from home must band together in a struggle that means life or death to them."
According to authors David Carlyon and Ken Emerson, the origin of the expression can be traced to 1848 when a member of Dan Rice's troupe was attacked at a New Orleans dance house. That man yelled to his friend, named "Reuben", who rushed to his aid. Another explanation is that the name "Rube" is a slang term for country folk (e.g., "Rustic Reubens"), usually shortened to "Rubes".
The Oxford English Dictionary's first entry for "Hey, Rube!" is from 1882, in the Chicago Times (3 Dec. Suppl. 12/4): "A canvasman watching a tent is just like a man watching his home. He'll fight in a minute if the outsider cuts the canvas, and if a crowd comes to quarrel he will yell, ‘Hey Rube!’ That's the circus rallying cry, and look out for war when you hear it."
The term is still known and used today in circuses, but usually as an allusion to the "glory days" when circuses were rowdy affairs, rather than in actual fights.
Read more about Hey, Rube!: Other Uses