I've occasionally struggled with this problem in the past, and I think it can be complicated, so I hope you are able to figure out what works for you . . .

A few thoughts, from personal experience:

It can be challenging to be in a social situation that involves food that irritates your system. Without knowing what your specific issues are, my advice would be to be very selective about what you eat in those situations. Have a good hearty snack before the gathering so you're not tempted to eat things that you know will cause discomfort later. Nurse your beverage of choice and a small salad/soup/appetizer if you're worried about other people feeling uncomfortable that they're eating and you're not. Don't let yourself feel pressured to eat things that will make you miserable. If someone wonders why you're not eating, it's perfectly ok to say "I don't do so well with X." Enough people have food sensitivities these days and most restaurants are used to adapting their dishes if you can pinpoint what you need, e.g., you might be able to ask them to leave out the cream if you have problems with dairy.

If you are having trouble with specific foods, it would be a good idea to figure out what they are so that you can take steps to avoid them. Sometimes you can re-introduce things into your diet after avoiding them for a while, other things you may want to just avoid. Everyone's different, I think you can google food allergy or food sensitivity to learn more about this.

There could be other "lifestyle" reasons that are making it hard to maintain weight. For example, I had a lot of trouble maintaining weight my first year of grad school. I was eating constantly but sleeping very little, and the whole experience was ludicrously stressful. I was 108 when I started school and dropped 15 pounds over two semesters. I went to my doctor who ordered some tests to see if there were medical reasons for my weight loss. They didn't find anything. Ultimately the solution was to leave that toxic grad school environment and try my luck elsewhere. It took me more than two years to rebuild my physical strength after that experience.

I think if you feel like you have enough energy to get through your rides, you probably don't need to eat more DURING; focus on getting the nutrition you need before and after.

Good luck, let us know how it goes.