You have to say what the old water heater model is exactly, and the exact model of the new one.
When I replaced a fridge in a TC we had, the gas line would not reach, much the same as your situation. I think you are not supposed to do this (use rubber instead of brass), but I made up a connection using a "rubber" hose for a BBQ and changed the ends on it. Got the connection parts at a plumbing store that also sells gas bits and pieces. You need to include a shut- off valve with the connection bits and pieces if the heater does not have its own.
Note the hole in the water heater where the brass gas supply pipe comes out front needs to be sealed so gas can't get back into the rig. There are installation manuals on-line if you didn't get one with the new heater.