Are you being, or have you been, treated for depression and anxiety? Both of those illnesses can cause all kinds of symptoms, and both of these are illnesses that can and should be treated. Once you get those under control, you may start feeling better and gaining weight.
If you are being treated, it's possible that you need a change in medications, and increase in dosage, etc. A
Are you working with anyone (i.e., psychiatrist, psychologist, pschopharmacologist)?