Actually you need a ballenced diet to gain mass.
Not only do you need Protein, you need energy from carbs, The fats make testosterone and other hormones, the friut and vegg you need for the vitamins and minerals that keep your body in check.
When you are gaining mass you are eating a lot too. And staying regular is really important. Fruits give you much needed fiber. You should take in approx 25 grams per day.
Fruits and vegetables add an alkaline loading that helps offset the acidic loading of protein (protein is a collection of amino acids). Keeping your body's pH level in line will help maintain muscle.