In the late 1930's, when Charles H. Baker Jr. wrote "The Gentleman's Companion", this drink was just coming into vogue
Accounts of the invention of the Cuba Libre vary. One account claims that the drink (Spanish for Free Cuba) was invented in Havana, Cuba around 1901/1902. Patriots aiding Cuba during the Spanish–American War—and, later, expatriates avoiding Prohibition—regularly mixed rum and cola as a highball and a toast to this Caribbean island.
According to Bacardi:
The world's second most popular drink was born in a collision between the United States and Spain. It happened during the Spanish-American War at the turn of the century when Teddy Roosevelt, the Rough Riders, and Americans in large numbers arrived in Cuba. One afternoon, a group of off-duty soldiers from the U.S. Signal Corps were gathered in a bar in Old Havana. Fausto Rodriguez, a young messenger, later recalled that Captain Russell came in and ordered Bacardi (Gold) rum and Coca-Cola on ice with a wedge of lime. The captain drank the concoction with such pleasure that it sparked the interest of the soldiers around him. They had the bartender prepare a round of the captain's drink for them. The Bacardi rum and Coke was an instant hit. As it does to this day, the drink united the crowd in a spirit of fun and good fellowship. When they ordered another round, one soldier suggested that they toast ¡Por Cuba Libre! in celebration of the newly freed Cuba. The captain raised his glass and sang out the battle cry that had inspired Cuba's victorious soldiers in the War of Independence.
According to Havana Club:
Along with the Mojito and the Daiquiri, the Cuba Libre shares the mystery of its exact origin. The only certainty is that this cocktail was first sipped in Cuba. The year? 1900. 1900 is generally said to be the year that cola first came to Cuba, introduced to the island by American troops. But "Cuba Libre!" was the battle cry of the Cuba Liberation Army during the war of independence that ended in 1898.
2 ounces light rum
1 ounce fresh lime juice
3 ounces Coca-Cola