If you have correct form then you should never be injured, easier said than done of course, some people are just prone to injury and have weak points.
But... once injured, the gym is definitely worth it, exercise makes my back so much better, If I have a lazy weekend, boy can I feel it on Monday