first off, it would be a coil gun, a rail gun is something entirely different.
it would be easier to just wind your own coils around the pipe with wire, than trying to adapt a motor to work... and I think you'd be rather unimpressed using photo flash capacitors to switch that large of a coil gun... The number of capacitors needed to fire a coilgun with a barrel as large as a piece of PVC pipe with any significant velocity could probably fill a small closet.
coilgun design depends very heavily on the placement, design, and control of the coils themselves, and I think that trying to us the coils from a motor, which are designed and placed completely differently, would yield poor results. You should look at some of the existing coilgun designs on the web to get an idea of design.