The reason you keep hearing the same advice is because putting on some pounds is really a simple matter of consuming more calories than you burn. Now, we all know at least one person who has made the mistake of eating a lot more than necessary, not exercising, and packing on lots and lots of excess fat. That's not what we're here to do. We want to give you the tools so you can eat just enough calories to put on some muscle, but not enough to put on a lot of excess fat.
Be aware, though, that increasing the calories you eat in order to increase your muscle mass will also bring some extra fat mass. Don't panic. With the right type of exercise, the fat gain can be minimal. And remember, if you've been struggling to gain weight, it's highly unlikely that you'll put on 20 pounds of unwanted fat.