Many guys here have the wrong mindset when it comes to working out.
Your physical body when you train it, should only but a complimentary to how your working out your Inner Game, Inner Peace and Emotional Diet your feeding yourself daily in life.
Examples of Emotional Diet and Disciplines -Yoga, having Giving and Unselfish goals that benefits others, eating healthy food, being a minimalist, not hoarding too much things and staying away from Toxic people. Having a lifestyle that you enjoy on a Spiritual primal level and almost feel like your a living happy monk sometimes because you practice Self restraint, discipline and delayed gratification in your life. If your jerking off to porn, not practicing semen retention and don't have chores or a to do list/projects around the house, then you need to do something about that.
When you go to the Gym, you want to be in a giving mood. As a Man your goal should not to be a womenizer or a Casanova, it's to be a Balanced Warrior or An Expert Social Butterfly with all humans - Men, women, children, and maybe even a few animals. With this mindset, you'll attract the best type of women.
When you go to the gym, your goal should be to make friends with everybody there and build a sense of social connection. When you talk to a girl you should already have a ton of girl your talking to so you're not desperate. Befriend all the women there, make a few jokes and banter with them a little bit. Give it some time, be patient, don't be manipulative and desperate for sex and treat the Gym as a training ground for working out first and you should be fine.