Yes, training and diet have nothing to do with it. 
Forgot to add this to the end Joe. (

).
Training, diet, genetics, drugs, recovery - all are needed.
Some people think they train hard, they don't. Some don't need to and still blow up anyways, good receptors.
If you want to gain weight, eat like you are that size you want to be (small steps), train hard, and recover/sleep properly.
Example - You weigh 200 pounds, but want to be 210, figure out maintenance calories for a 210 pounder, for your lifestyle/activity level and add them (calories) in.
Even if it takes you a year, and put on a little fat, so what, youre not going to be "Mr. O" or "Mr. Thong-Oil", etc.
For those twinks who like their abs and 30 inch waists, that is also good, stay healthy.
You want to get stronger w/out injury, do a progression and build up over time, not like the 'black cat-arched back' deadlifters of JewTube.
(5/3/1, German load progression, etc).
The stuff is very easy, modern day nimrods on Instagram and YouTube act like they invented this stuff. Bizarre...