Fruit flies (Drosophila spp) and bananas have such a ubiquitous relationship that these insects are sometimes dubbed "banana gnats." These common kitchen pests love to breed and feed on moist, sweet organic matter, making the monkey's favorite fruit an ideal target. Ultimately, keeping your bananas fruit-fly-free boils down to proper handling and storage of bananas.
Clean and Clear
Because fruit flies dwell on the surface of produce rather than penetrating deeply into the fruit, washing your bananas as soon as you bring them home may remove eggs and larvae and prevent adult bugs. Simply run the bananas under clean water for about 20 seconds and dry them thoroughly before leaving them to ripen.
Refrigerating for Safety
You can ward off fruit flies entirely with one simple action -- stick your bananas in the refrigerator. Fruit flies don't have an internal temperature-regulating mechanisms, so they don't dwell in chilly spaces. Refrigerating ripened bananas is especially crucial -- stick browned bananas in the freezer and use them later for smoothies. If fruit flies do get to your bananas, cut off the affected areas, dispose of them and store the remaining fruit in the fridge.