He is blocking the entrance to the gym and you must battle him to enter. Luckily, Wally is rather weak, with only one Level 16 Pokèmon.Once you beat Wally, he will run away and allow you to access the gym.
 This is an electric gym, so you will need some anti-electric Pokèmon to succeed.Watson is hidden behind electrified walls, but you can easily move these out of your way by stepping on the lightening bolts. The walls will reposition so you can walk through., Watson will award you with the Dynamo Badge and TM - 34 Shock Wave once he is defeated. The badge will allow you to use Rock Smash outside of battle, so you can access areas that are blocked by rocks.
Go to the Mauville Gym and battle Wally.
Battle Watson, the gym leader.
Obtain the Dynamo Badge.
{"src": "wikihow-all_validation", "title": "How to Get Rock Smash in Pok\u00e9mon Ruby2"}