You ask either gnome one question. If I were to ask the other gnome which way is the path to hell, what would he say? and then take that path. The liar would point to the path to heaven because he lies, and the truthful one would point to the one to heaven because he knows the other would lie.