Spices to avoid when you have gastritis include all types of pepper (black, red, cayenne, or chili pepper), garlic, mustard, and nutmeg. People with gastritis should also avoid tomato products, onions, and sugar.