Photo from uberculture's photostream
Since I started lacto-fermenting vegetables and fermenting plum pits recently, I seem to draw an abundance of fruit flies into the prep area. Both of the types of ferments I am doing allow the CO2 pressure inside the containers to push past the seals and run down the sides of the containers... and sometimes even pool in a saucer underneath them.
There is an easy way to attract and trap those pesky fruit flies, though.
Take a small glass or jar and put a fruit scrap, some beer or some fruit juice in it. (If you use a fruit scrap, add some water.) Then put a drop or two of dish detergent in the liquid (the detergent changes the surface tension of the liquid).
Cover the top with a piece of plastic wrap and secure it tightly over the top with a rubber band. Take a small pointed object like a pencil or large nail and poke several small holes in the plastic wrap. The fruit flies are attracted to the smell, get in and cannot get out; most will drown. Instant fruit fly trap!