Ok, what you need to do is go to the suspicious shop with the suspicious sign in front. It should have antennas coming out of the top or something. Go in there, and you will see Lance and his Dragonite roughing up a Team Rocket Grunt. He then shows you a hidden passage, and you go to the Team Rocket HQ. After you are finished with Rocket HQ, the gym should be unblocked.