So I'm going to assume that the Gym Leader's Pokemon only knows Ghost type moves, and you're using a Normal type Pokemon.
You don't need to shut down the game. But, based on the information, your Pokemon will faint if you continue the battle.
In addition to the 4 moves a Pokemon can know, it also knows an "extra" move called Struggle. A Pokemon will only use it if it's 4 known moves tun out of PP. Struggle is a low damage Normal type attack, that causes recoil damage to the user.
Getting back to your scenario, both you and the Gym Leader opponent will be "stuck" until the Gym Leader's Pokemon runs out of PP on it's moves, then starts using Struggle, and eventually making your Pokemon faint. You will then be able to send out another Pokemon and take advantage of a heavily, heavily weakened Ghost with no PP on any of it's moves.