Hi there,
A healthy and regular meal is vital to gain or lose weight. Consuming more calories than you burn will help in gaining weight. Try to gain weight in a healthy and steady way. Eat lots of fruits and vegetables. You may consult a nutritionist and get a diet chart made which will provide you with adequate calories in a healthy way. There can be many causes which can prevent a person from gaining weight. The common causes are hyperthyroidism, diabetes, severe anemia, certain STDs, worm infestation, and certain liver disorders. If you are unable to gain weight rule out conditions mentioned above. Do keep me posted.
Take care and regards!