27 was my magic age and life catches up to you. My early to mid 20s I was about 205lbs and I couldn't put on weight for anything. I'd eat and eat and my metabolism would just burn it off. I'd sleep 3-5 hour a night because I had so much energy. When I hit 27 I hit the weights with some renewed vigor and with diet and good sleep I jumped to about 230lbs. I'm now 29 (for a bit longer) and I walk around about 245 and hit about 235 when competing.
Quitting smoking and laying off of caffiene would be real beneficial for weight gain. Also try to get a consistent night of 7-9 hours of sleep. Avoid processed foods as you can. Also, we picked up a Vitamix blender a while back and that thing has improved our eating habits a ton.
Age and lifestyle changes will probably put quite a bit of weight on you. Don't be surprised if you lose a little weight at the start of training, that is totally normal.
Weight gain is simple in theory: Calories In > Calories Out
I'll promise you if you eat more you'll gain weight. Also make sure you stay hydrated all the time.