Raw cucumber is notorious for producing gas in many people.
I think diarrhea is often the body's way of getting rid of what shouldn't be in the digestive system. As for spices, you could first try using just ginger. Ginger is very calming and helps solve many digestive problems. Later you could slowly add cayenne and cloves. If what you are eating is killing some pathogens in your digestive system, then diarrhea is the way the body quickly gets rid of the dead pathogens.