ok. this is a little bit hard to explain but let me try.
first: make sure your game is x and the clock is after 8pm and before 9pm
when you enter the gym, take the first rock wall up to your right, then you climb the set of stairs and then climb the rock wall to the right. You'll come up to a place1which will have the Tyranitarite
look here for a more detailed description
hope I helped :D