Common sense. Gas dryer needs a supply source for gas.
Electric version needs an electric supply source.
If you bought a gas dryer and you have no supply source for gas, then common sense dictates that you can not use it.
I would return/exchange it (if you still can) and get the electric dryer so you can use it without gas.
Again, common sense.