This happened to me too when I started gluten-free diet.
The problem was I did not know how to avoid foods with "hidden" gluten. For example, I did not know soy sauce had gluten, so I would get gastritis every time I ate chinese food.
Also because I did not understand what was happening, I may have had hot sauce with the food, or coffee afterwards, and both hot sauce and coffee will make gastritis worst. If you think you ingeted gluten by mistake, do not have hot sauce or coffee for 12-24 hrs afterwards, you will get better faster.
Now I am getting better at knowing which foods may have hidden gluten, with experience and reading about gluten ingredients on the internet. But still once in a while I forget to ask the server in a restaurant and order something that I think is gluten free but ends up giving me gastritis.
I know it must be some hidden ingredient because I NEVER get gastritis from foods I cook myself at home or from a few restaurants that the servers know me and know I cannot eat gluten. Also a few restaurants have gluten free menus, that is your best option because they have procedures back in the kitchen to handle food ordered from gluten free menu in a way that is not contaminated with gluten.