I'll share my own experience on how I, a pure vegetarian went on to gain over 12 kilos of mass(mostly muscle) on a pure vegetarian diet over a duration of 2 years.
It opened up a whole new window to approaching on how & what to eat.
So if you are a vegetarian & have been told that you cannot put on muscle, you've been lied to. Don't give up just cuz you've been told.
Some resistance training followed by a jog or brisk walk will magically transform your health.