the gym can come later, but for people who went really far down a road of unhealthy lifestyle I think the gym can actually be counterproductive. It's probably better than doing nothing, but it can be overwhelming and most people don't realize that the only thing you really need to do is get your heart rate up.
If you are grossly overweight the way that i was, getting muscle definition that the gym can deliver shouldn't really be on your radar for a while.