>In Generations I and III, when the player first reaches the Gym, it is locked due to the absence of the Gym Leader.
>With this acknowledged, the player journeys off to other Gyms to challenge them. Once the player has collected the other seven Gym Badges, the Viridian Gym reopens.
___
Source: Bulbapedia/ Viridian Gym