Nunty, I'm delighted to have you, our resident Anne of Green Gables expert, clear things up for me.There is apparently an old saying that you have to "eat a peck of dirt" before you die. (A peck is a measurement of volume.) Here is one reference. The expression could apparently be metaphorical ("dirt" meaning unpleasant life experiences) but is being used literally here, as owlman explained.
Given the historical period and rural setting of Anne of Green Gables, the expression fits very nicely.