Our drummer, who is a long-time nightlife guy (more than me), made an observation a while back; the bands that get the most and best gigs aren't the ones that are the most musically proficient. They're the ones that are the most fun. Which isn't a reason to give up and not improve, but more encouragement to cut yourself some slack. The critical thing in a live gig is the time the audience is having, and you may be doing better at delivering a good time than a note-perfect performance.
My general rule is to push in rehearsal to be as perfect as possible, then anticipate that you'll lose 10% of it live. The sound environment is different, there's more nerves, and (especially in bar gigs) lots more distractions. Is that person coming over to talk to me? - Oh, no, he's just going to the bathroom. What's the person yelling about over there? Is that noise coming from MY gear? Does the guitarist remember how we said we'd transition into this one? Wow, that woman has a nice figure. Oops, I shouldn't stare. Is that guy her boyfriend? Is that the Bruins on the TV? Oh no, I can't see my fretboard dots in this bright light! Hey, everyone's getting up and dancing, this is awesome! Wait, why did they stop, I thought this would be a sure-fire dance tune. Etc. etc. etc.
As far as I have found, the best solution to all this is just to gig as much as possible. In a sense, playing in a distracting environment trains you to play with distractions, that you don't have at home. I'll also mention, in general, stage shows throw a lot less of these distractions at you than bar gigs. The sound is more controlled and you're more buffered from everything else going on (or there's less "everything else" in the first place, really).