Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Oil and gas companies scrambled Thursday to prepare for Hurricane Harvey, which developed so quickly in the Gulf of Mexico that many of them didn't have time to respond.

Royal Dutch Shell shut down and evacuated its 22-well Perdido oil and gas hub, the deepest floating oil platform in the world, the company said. Other major companies, including ExxonMobil and Anadarko, also began scaling back production as Harvey zigzagged toward projected landfall over the central Texas coast sometime Friday night.

Valero's Port Arthur, Texas, refinery in September 2005. Rick Bowmer / AP file

The Gulf produces about 17 percent of all U.S. crude oil output and nearly half of the country's refining capacity, according to the U.S. Energy Information Administration.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

By Thursday afternoon, 39 production platforms — more than 5 percent of all manned platforms in the Gulf — had been evacuated, according to the Bureau of Safety and Environmental Enforcement, an agency of the U.S. Interior Department.

Evacuations and other preparations had shut off about 10 percent of the region's overall crude oil production and 15 percent of its natural gas production, the bureau said.

The risk of tighter inventories drove gasoline futures to their highest prices of the month, up by 2.8 percent Thursday afternoon, according to government data. Average gasoline pump prices were up by almost 0.2 percent Thursday over Wednesday, according to AAA, but rises were sharper in the Gulf region — an average gallon of regular was up by 0.33 percent in Texas.

Related: Hurricane Harvey Rainfall Poses Danger to Ill-Prepared New Orleans

A map shows potentially threatened oil and gas facilities in the Gulf of Mexico as Hurricane Harvey approached the Texas coast on Thursday afternoon. U.S. Energy Information Administration

Andy Lipow, president of Lipow Oil Associates, a Houston consulting firm, forecast an eventual 10 cent-per-gallon impact on gasoline prices east of the Rockies, telling CNBC that if Harvey makes landfall as a Category 3 storm, it could take as long as three weeks for refineries in its path to resume normal operations.

"That is because in Category 3 there is more likely to be lots of evacuations, widespread power outages, wind damage, flooding and difficulty getting workers back to the facilities," Lipow said.

Alan Gelder, vice president for refining, chemicals and oil markets at Wood Mackenzie, an international energy research firm, told CNBC that the companies were "making decisions with poor information or lots of uncertainty."

"I think they're in a time crunch, because this storm didn't exist yesterday," Gelder said.