A space railgun is theoretically possible, but you'll still need a rocket to circularize the orbit.
In practice, a rocket goes up (out of most of the atmosphere) before going fast. A projectile fired out of a railgun would be going at its fastest while still in the atmosphere, and would thus be very hot / inefficient at the gun's "muzzle"
Heinlein's "The Moon is a Harsh Mistress" discusses such a solution for sending mined material back from the moon, which seems like a more feasible application.
The whole system is indeed possible, though. See this discussion:
http://physics.stackexchange.com/questions/35139/what-is-the...