For me it is not eat too much right before a ride, in general, and definitely not too much sugar. I am better off eating small amounts while riding. Just as important is plenty of water. For on bike hydration, I use a mixture of 75% water and 25% real fruit juice and just enough salt to know it is there. IME, riding hard is a factor. You have to drink before you feel thirsty. What you are describing is a serious episode of reflux. I have been on reflux meds for many years and it is under control most of the time. When it flares up, I usually know why, I consumed things I should not consume, and too much of it.