Please post the check engine code. This code should have given you a few choices besides gas cap such as evap. system small leak detected. Then you can try a visual inspection of the gas filler neck and charcoal cannister and surrounding connections. The only sure way is to get a smoke test done at a shop. Please post code though.
Agree with the answer above. Codes only indicate where to start looking. Evaporative Emission system problems are difficult for anyone to diagnose/test and repair themselves at home. Some evaporative diagnosis requires a scan tool to bi-directionally control solenoids to seal off and open and test for leaks. Another useful tool is a machine that generates an inert gas/smoke that when the system is sealed off, if there are any leaks the smoke "show up" where they are. Also some faults can be intermittent and when the codes are erased the self test procedures your computer uses to test the system can take a week or two to self complete as a certain specific drive procedure has to be performed.