Absolutely not! What would be the point of a gym if you had to get in shape to join one?
If you're worried about what others think of you... don't. Everyone at the gym is worried about one thing: Themselves. They're not looking at you, nor considering anything about you. In most cases, they're focused on not hurting themselves. :)
You don't need a gym to get in shape, but you shouldn't wait to get in shape to join one if you want to. I joined, an dlost 24 lbs and had a blast, made some great friends, and learned a LOT.