Electrical problems occur when the gas line is working properly but the ignitor is not receiving power. When this happens, the ignitor cannot produce the current that heats it up enough to ignite the gas. This is dangerous, because it may allow gas to build up in the dryer while the ignitor continues to fail. In this case, the wiring to the ignitor has failed or the ignitor sensors have failed and will need to be replaced.
Sometimes the ignitor itself can go bad. In gas dryers, the ignitor is typically a small cone of metal that acts as a mini heating element, heating up quickly using electrical resistance until it is hot enough to ignite the incoming gas. This ignitor can burn out over time. You must replace the entire ignitor in order to fix the problem.
Gas dryers have valves that control how much gas flows into the dryer. Sometimes the ignitor can be working perfectly, but the electrical coils that signal the gas valve to open can develop defects. If they do not work properly, the gas valve will not open and there will be no fuel for the ignitor to light. Replacing all the gas valves will usually solve this problem.
Dryers have a thermal fuse, a safety feature wired into their electrical systems. This fuse is designed to melt at a certain temperature. If the dryer overheats, the fuse will automatically melt and shut down all electrical functions in the dryer's heat-producing components. If the ignitor does not function at all and the heating process does not seem to be working in any way, the thermal fuse may have blown and will need to be replaced.