The best way to prevent a green carrot cake is to peel your carrots before shredding. If this step is skipped, the peels sometimes take on a green color after baking. This is harmless and the cake can still be enjoyed, but it's not quite as attractive. Some sources also claim that your cake may turn green if you accidentally use too much baking soda or if you don't mix your dry ingredients well enough (and the baking soda isn't evenly distributed).