Yoga and Gym both are good and related with overall fitness of our body and I have seen many gyms using Yoga first to warm up before they do go for any kind of other heavy exercises...
both have different consequences . yoga is mainly for meditation means for the peace of mind also different types of yogas are used to be fit and cure diseases.Gym is beneficial for maintaining health.
Both are the different things ...in gym you can do the excercise of muscles and body building which you cant do in via yoga,, and yoga means meditation and a lot of aasan which gives you immense peace and relax you fully.