system
Given the following post, respond as if you're commenting on Reddit:
human
Why are electromagnetic railguns not used to launch rockets into space?
gpt
Because then it wouldn't be a rocket, it would be a bullet.

But seriously, many people have considered this approach and put together designs to do just that.  The biggest barrier to their implementation is that with a railgun you need to impart all the kinetic energy into the payload before it reaches the end of the "barrel," whereas with a traditional rocket you can spread that acceleration over the entire flight.

In practical terms this means you either need cargo that can survive hundreds or thousands of Gs and a relatively short barrel gun (not to mention incredible heating from friction once out of the evacuated barrel), or you need an incredibly long barrel and can then transport more delicate cargo/humans.  Unfortunately the lengths of barrel you need essentially take you all the way into space (tens to hundreds of kilometers).

As of right now, even though rocket launches might cost hundreds of times more per kg of cargo, they are still the easiest and best understood method for putting stuff up into space.