Yeah that's why you do multi-stage like conventional jet -> ramjet -> scramjet
But again, yeah if it needs to carry a rocket then it might be unfeasible. We could try your gauss cannon idea, that sounds fun. Like a maglev train, but shaped like those rides from roller coaster tycoon where you could launch people to their deaths. Except instead of crashing, the rocket kicks on mid-flight. It could work.