Because we have so much fresh produce sitting around all the time, fruit flies are an issue we deal with from time to time. I have done a lot of research online, and tried many methods of getting ride of them, and I have come up with what is, for us, the quickest, easier, and surest way to get rid of them.
Gather a jar, cup, bowl or other such container, some red wine vinegar and some dish soap. I have heard the saying "you can catch more flies with honey than with vinegar" but I no longer believe it, red wine vinegar works like a charm.
Just add several tablespoons of vinegar to your container, then add in some dish soap. One or two drops is probably all that's needed, but I always want to be extra sure that I catch them, so I add one or two teaspoons. There is no need to measure, just eyeball it.
The flies are drawn to the vinegar, then because the soap had broken the surface tension, they drown. Just set it out where you have fruit flies, and wash it out or throw it away when it's done it's job. Easy as that!