Ruben, who devoted much of his later life to being a court-appointed advocate for abused and abandoned children, died Saturday of complications from pneumonia at his home in Beverly Hills, said his son Tom.
A Chicago native who began his comedy writing career in radio after serving in the Army during World War II, Ruben helped write radio shows for Dinah Shore, George Burns and Gracie Allen, Fred Allen, Henry Morgan and Milton Berle.
Moving into television in the early 1950s, he was a writer on specials starring Danny Thomas, Ed Wynn and Eddie Cantor. He wrote for "The Milton Berle Show," "Caesar's Hour" and "The Phil Silvers Show," where he also began directing.
Ruben produced "The Andy Griffith Show" from 1960 to 1965 and also wrote and directed some of the episodes of the popular CBS series.
"I'm frankly surprised at this show having become an icon, really," Ruben said in a 1999 interview with the Archive of American Television.
He recalled receiving letters from older fans at the time saying that the series spurred nostalgic memories of their own experiences growing up in small towns like the show's Mayberry, N.C. "And my theory," Ruben said, "is that the Griffith show is like the grown-ups' Oz. It's the land of, 'Oh, wouldn't it be wonderful to live in a town with no drugs, no crime, no gangs, no violence, [a place where] people greet each other, people are kind to each other.' . . . That's why grown-ups love that show."
Movie director Ron Howard, who played young Opie on the show, recalled that Ruben gave him his first 8-millimeter movie camera on his eighth birthday, "which turned out to be really significant because I actually did get into it and started making little movies almost right away."
"My recollection of Aaron was he took a tremendous amount of pleasure in collaborating with the cast and encouraging creative input in the scripts from all of us, even me as a kid," Howard told The Times on Monday.
As the show's producer and head writer, Howard said, Ruben "was relentless in trying to fulfill the potential of a story or a scene or a moment."
Jim Nabors' lovably naive filling station attendant Gomer Pyle proved such a popular character on the show that Griffith pressed Ruben for a spinoff series for Nabors.
In the 1999 interview, Ruben recalled: "I had been thinking about a notion of where do you put Jim, where do you put this guy -- this, as somebody said, this Christlike character, who was so good as almost not to be believed, decent, kindly -- where do you put this guy except in the greatest war machine ever invented, the Marines."
"Gomer Pyle, U.S.M.C.," with Ruben as executive producer, aired on CBS from 1964 to 1970 and was the No. 2 top-rated program in the Nielsen ratings for the 1965-66 season.
Teaming up with Carl Reiner, Ruben co-wrote and co-produced "The Comic," a 1969 movie directed by Reiner about the rise and fall of a silent film comedianstarring Dick Van Dyke.
In the 1970s, Ruben was the initial producer of "Sanford and Son," the hit 1972-77 series starring Redd Foxx and Demond Wilson for which Ruben wrote many early episodes.
Among his other credits as a producer or executive producer are “The Headmaster,” "C.P.O. Sharkey," "Teachers Only," "Too Close for Comfort" and "The Stockard Channing Show."
"Aaron Ruben was one of the wittiest and most gifted comedy writers," Reiner told The Times on Monday. "Besides that, he had a very warm heart.
"If he came to somebody's house for dinner, after the perfunctory hellos, you always found him on the floor with the kids. He had a gift for entertaining little kids. That's an indication of what kind of man he was."
Indeed, for several decades, Ruben devoted himself to being an advocate for troubled children and doing hospice work.
His involvement with children's causes reportedly began in the late 1970s when he and his wife, actress Maureen Arthur, dropped off Christmas presents for children at Los Angeles County-USC Medical Center.
Passing out the gifts inspired the Rubens to put on skits for the children on weekends. After eight years of weekly visits to hospitals and children's shelters, Ruben became a court-appointed special advocate representing abused and abandoned children in Juvenile Court. He also volunteered for the Hospice Program at Cedars-Sinai Medical Center.
In 1999, Ruben was named volunteer of the year by the Los Angeles Child Advocate's Office and established the Aaron Ruben Scholarship Fund.
Ruben, who was born March 1, 1914, attributed his longevity to his work with children.
"I have this fantasy," he told Daily Variety in 2003, "that once a year St. Peter appears before God and they go over the list of people that they're ready to take and my name comes up. God says, 'Is he still doing that work with the kids? Ah, let him stick around a little longer.' "
Ruben was divorced from his first wife, Sandy, with whom he had two sons, Andy and Tom. He is survived by his wife Maureen; his sons; two grandchildren and three great-grandchildren.