If you have been able to gain weight in the past, nutrient absorption may not be the issue. When working to gain muscle, you just need to be very careful about what you eat and how much. if you are gaining more than 2 lbs. a week, it probably is mostly fat. Also, you can add some interval training, which will help limit fat gain without cutting into muscle stores.
There are specific tests to see about ones nutrient absorption, aren't there? If one were to have a gluten problem would it be just the gluten not getting absorbed, or could one also have problems with other proteins or carbs too?