Since the Iranian Revolution occurred during the Carter administration and the OAPEC oil embargo occurred during the Nixon administration, the reason for the gasoline price hikes cannot be attributed to the Iranian Revolution which had not yet taken place.
The greatest shortages took place in the early 1970s, so, therefore, the revolution of 1979 cannot be the cause. Part of the cause of OAPEC's embargo in 1973 was the US support of Israel; the Arabic nations sought to punish the United States for resupplying the Israel military. This conflict was termed the "Yom Kippur War" when oil jumped from $3.00 per barrel in 1972 to over $12.00 per barrel in 1974.
By 1974 Secretary Kissinger negotiated an Israeli troop withdrawal from parts of Sinai. This promise of a negotiated settlement between Israel and Syria prompted the Arabic nations to lift the embargo in March of 1974.
As a result of the America's dependency upon foreign oil, a move was made after this AOPEC embargo for production of American oil as well as provision for oil reserves. (e.g. The National Oil Reserves)
The major cause of the spike in gasoline prices in the late 1970s was the Iranian Revolution and the Iran-Iraq War that followed it.
Before 1979, Iran had been ruled by the Shah (King), who had been supported by the US. In 1979, a revolution led by Ayatollah Ruhollah Khomeini (Ayatollah is a religious title) overthrew the Shah and instituted an Islamic government in Iran. Soon after this happened, war broke out between Saddam Hussein's Iraq and the new Iranian government.
This caused an price spike because both of those countries were major producers of oil. Because they were fighting, the supply of oil in the world dropped by 10%, thus causing price hikes.
The serious gasoline supply/price fluctuations began in 1973 with the Yom Kippur War.
The United States provided a steady supply of military support to Israel. The Organization of Petroleum Exporting Countries (OPEC), a group of mostly Arab nations largely opposed to Israel, placed an embargo against the U.S. to protest American support of the Jewish state.
The cut-off of oil to the U.S. from the Middle East greatly influenced the American economy and culture. The embargo was lifted in 1974, but then the situation described by pohnpei397 occurred a few years later and caused a fuel crisis again.