The projectile must be in physical contact with the rails because they pass current through it to create the magnetic field that reacts with the larger field surrounding it.
I say "must be in physical contact", but this is only necessary initially. Once it gets moving, I imagine most of the current flows through the plasma created by the air between the projectile and the barrel.
I expect it is this super hot plasma that eats away at the barrel.
I am out of my depth in this, to be sure, but that sounds appropriate.