The Ordway Center production of “Paint Your Wagon” that opens Tuesday will be credited to Lerner and Loewe, the legendary Broadway team that wrote “My Fair Lady” and “Brigadoon.”

But the producers have chucked Alan Jay Lerner’s book and invited New York playwright Jon Marans to craft a new version.

Frederick Loewe’s songs are still moving and beautiful. But the story to which “Wand’rin’ Star” and “They Call the Wind Maria” were attached? Not so much.

“In the original book, the lead guy was a cranky and crazy old coot,” said Marans, who flew into the Twin Cities recently for a look-see. “What I wanted to do was find a main character with a dilemma who’s larger than life and not so dated.”

He also wanted to infuse historical accuracy into the Old West story, which premiered in June at Seattle’s 5th Avenue Theatre before coming to the Ordway, which is collaborating on the production.

The show is still being tweaked with an eye toward Broadway. Like the original, it’s set in a 19th-century California Gold Rush town where some characters have come to seek their fortune. Unlike the original, it has a very diverse cast.

“That’s truer to the reality and history of what was happening in those places,” Marans said. “The whole world would be drawn to a Gold Rush town, and they would all have these crazy, mixed-up backgrounds. That was a microcosm of the idea of America.”

The central character is prospector Ben Rumson, a widower who recognizes his biases and undergoes a transformation. But Marans’ version also includes two Chinese brothers, Mormon sister wives, a boozy Irishman, a free black man, a white southerner with his enslaved black man (who happens to be his half-brother) and a formerly wealthy Mexican rancher.

Their disparate dreams and desires cause the show’s friction and sparks.

Getting on the ‘Wagon’

Marans, whose “Old Wicked Songs” was a Pulitzer Prize finalist 20 years ago, did not seek out “Wagon.” His lawyer got a call about five years ago from the folks at 5th Avenue Theatre, wondering if he would be interested in reworking the book.

“I thought: ‘They know that I write sharply political stuff, right?’ ” he said.

He hadn’t seen a stage production of “Wagon” or the 1969 movie version starring Clint Eastwood and Lee Marvin. But he knew some of the music.

“There’s this wonderful tension, this push-pull element, to ‘Wand’rin’ Star’ — ‘Do I know where hell is? Hell is in hello,’ ” Marans said.

If the music was his hook, the history of the era was a revelation.

“These 19th-century Gold Rush towns were richly diverse places — they were like New York in the Old West.”

Working with director David Armstrong and other members of the creative team, Marans drew on real people to craft the characters.

“One of our inspirations was someone who lost his mother and his wife in the same month when he was 30,” said Marans. “He was broken, went out West, but then came back to New York, became police commissioner, lost a race for mayor, eventually became governor and then president of the U.S. He was Teddy Roosevelt.”

Marans also drew on H. Ford, a free man of color from the North. “I got to dig into history and mix that research with imagination, and it’s been very exciting.”

One revelation to Marans was the Californios — aristocrats of Spanish descent who lost their protection and properties in 1848 when Mexico ceded California and most of the present-day Southwest to the United States after the Mexican-American War.

‘The border crossed us’

Actor Justin Gregory Lopez plays Armando, a Californio who delivers the mail.

“Latinos like to say they didn’t cross the border, the border crossed us,” he said, laughing. “During the Gold Rush, these people who were now kind of stateless were pushed off their land by the settlers. Of course, they’d pushed other people off the land to claim it, so they were part of a cycle of dispossession.”

While that history informs the show, it doesn’t weigh it down, Lopez said. “The people who went out West didn’t have time to belabor the past. They were on the make, and they were constantly trying to strike it rich.”

The actor, who has been with the project for three years, said he expects the show to hit a nerve, if not strike gold.

“Westerns have done a disservice to our story because so many of them are about cowboys and Indians,” he said. “But America is this great experiment. And in the boomtown, you get the feeling that it might work, even if it’s filled with struggle, racial tension and this crazy mix of people.”