Let me explain what a railgun is....
A railgun is a gun (Duh.) that fires a one pound steel rod that travels at eight, not seven (Don't trust Wiki, boys and girls.) times the speed of sound, powerful enough to reduce a M1A1 Abrahms tank to a pile of steel wool. That's the description for the destroyer-mounted ones. It fires this using a large electromagnet at the end of the barrel, however, the recoil, if not controlled, would send the ship with the gun to a firey end.