The character of Gomer Pyle was inspired by this funny encounter with a real gas station attendant
Surprise, surprise, surprise: Gomer existed in the real world!
"Oh I forgot to tell ya," Gomer Pyle says to the Mayberry bank manager in the very first episode of The Andy Griffith Show that we ever saw him in, "The door's still hot."
The episode was called "The Bank Job," and in it, Gomer is fetched from Wally's Filling Station to bring a torch to break Barney out of the bank vault he's locked himself in to prove the bank is not secure. Gomer doesn't say much in this first appearance, but it's likely if you're a fan of his, you read those lines in a certain cadence. That's because not just anybody in Mayberry sounds like Gomer Pyle.
According to Everett Greenbaum, The Andy Griffith Show writer who helped create the character of Gomer Pyle, when he sat down to create the rhythm of Gomer's voice, he had a specific character in mind: Pa Kettle of Ma and Pa Kettle, the comic movie hillbilly duo from the 1940s and '50s. Greenbaum told the Archive of American Television: "I had never seen Jim Nabors, so when we wrote it, I used... as a voice pattern, Pa Kettle. … ‘I don’t make the rules, you know? A cow's gotta have socks.’ ‘Good news, Mr. Fuller! We struck mud.’ That was the pattern that I used, and then in Jim Nabors’ mouth, it turned into something completely different. That was very good.”
Greenbaum actually told the story of what inspired the character of Gomer Pyle in his interview, and would you believe it? Gomer Pyle, on top of being named for Gomer Cool and Denver Pyle, was based on a real gas station attendant that Greenbaum happened to encounter when something odd was happening with his car one day.
As Greenbaum recalled, he was driving around when his car started acting like it was low on gas, even though the meter didn't seem to read that he was out. He pulled over to a gas station to see what the trouble was, and that's when he met the gas station attendant who he couldn't help but turn into a character on The Andy Griffith Show, because he already seemed like somebody from Mayberry:
"We were going to do a show in which we introduced Wally, a new character, the mechanic, and they were very careful about hiring this actor who was going to be Wally, and then one day while we were working, I was on my way someplace, and I got low on gas. And I stopped for gas, and this kind of simple-minded guy waited on me, and I said, ‘I don’t know what’s going on here. It says full, but it seems to be empty.’ And he said, ‘Well, sometimes you’ll get an F when it’s an E,’ and I thought, ‘This guy should be on the Griffith show!'"
Once Greenbaum got back on set, he talked it over with writer Jim Fritzell and producer Aaron Ruben, and the next thing he knew, word had travelled to Andy, and the star knew just who to cast: "We suggested that we have a guy who works in the gas station who was kind of simple-minded and we gave him a name. Gomer came from Gomer Cool, who was our comedy writer, and Pyle came from Denver, who was an actor on the show. And Andy had gone to a place called The Horn and seen Jim Nabors do his act and he thought he’d be good on the show.”
Of course, Andy's instincts were dead on, not only successfully bringing in the actor who brought to life one of Mayberry's favorite faces, but also launched his own spin-off in Gomer Pyle, U.S.M.C. (which was also thanks to Andy's instincts). In his interview, Greenbaum still seemed struck by how Nabors elevated what he'd created for the character on the page: "He made a Jim Nabors character out of it. Took these lines – we never showed him how it sounded when we were writing it – and it fit.”