I had the same problem with Ranger 4.0 A/T 4X4 extended cab. Took it to Ford dealer and shop supervisor said they had a lot of similar complaints. He asked if the engine light was yellow or red. He said if it was red to park it immediately as it would hurt the engine to keep driving but if it was yellow it only indicated that something non-emergency was wrong and often they found that the customers did not properly tighten the caps. He said to click them at least 3 times as they ran under pressure.
It was discovered upon further inspection that there was a crack in the filler tube keeping it from pressuring and I had it replaced and problem solved. It is a plastic part.