Even when using fruit and vegetables, flies and some rodents may be attracted if the scraps are exposed. Bury all food scraps beneath a thick layer of brown material such as grass clippings or newspaper. It is also a good idea to wrap food scraps in newspaper before burying them in the compost pile.