alternative method. if you don't have any vinegar on hand, you can also trap fruit flies by placing a piece of overripe fruit in an open plastic bag. wait for the fruit flies to congregate on the fruit, then carefully seal the bag, trapping them inside.