Ask Experts & Get Answers to Your Questions - ASAP
Couple of options (besides tracking down the most likely cause - more of the rotten fruits)
If you've got a swarm, you need to eliminate the source. It seems gnats are attracted to vinegar. Fill a jar almost to the top with vinegar, poke several small holes in the lid and then set it out. The gnats will come to the jar, wiggle down into the hole, and will not be able to climb back out.
You could also buy a fogger... that could help - but first I would track down the other rotten items (or give a bit for them to head out if those are gone) - then try the vinegar trick before using the pesticides.
All the best. Please be sure to hit accept as that is the only way I am credited for my response to you today.