When I first started working out, I couldn’t gain weight no matter what I tried. I asked a large amount of people at the few gyms I attended at the time, and the advice received has always stuck out: Eat everything. The first (extremely in-shape) person I asked told me to buy a box of bakery cupcakes from the local grocery store and eat that after lunch a few times a week. The next (very ripped and cut) person I asked told me he ate a tub of chocolate pudding a few times a week after dinner. The message was clear: So long as you’re correctly working out, the type of food you eat doesn’t matter as much as you may think.
Of course, there's a lot more to the story. Link