Meh, I have never found a good way to deal with them. Well, other than putting all the fruit in the fridge and pouring boiling water down the drain every day for over a week to kill any that were breeding down there. A friend mentioned that with all the bits that get stuck in a garbage disposal, they often make their last stand there!
Last year when at our old apartment we went to Seattle for a week and apparently forgot to hide away an apple or two. I came home to a kitchen covered in fruit flies...the cabinets, ceilings, counters, etc...all over 2 apples that weren't even rotted! I still get nauseous thinking about it. *shudders*
I tried a new spray this week to get the ants out of my kitchen, it's made by EcoSmart. The one we got is in an aresol/pressurized can. I feel awful about actually killing them, so instead I got up super early and sprayed all their normal trail areas with it, hoping they'd find somewhere else to go instead. Wow, does it smell strong! Like cinnamon though, since the active ingredients are pretty much essential oils. They've been gone for over a week. I don't keep fruit on the counter after the above incident with fruit flies, but you might want to try the spray to see if it works! If not, it'll still be handy to have around for other bugs. I picked it up at the grocery store for about $6. Google it and their website will come up with a store locator. Good luck!