I'm certain that by 2080 at most, superior compact power generators (possibly fusion or carbon nanotube ones) will be perfected enough that gunpowder weapons will be completely phased out since railguns and plasma cannons will give much better penetrating power and accuracy than any rifle cartridge.
The very first railguns would be strategic static ABM systems since there wouldn't be a size limit for a power generator and this would probably increase rate of fire as well as power. They wouldn't completely replace ABM missiles at first due to still lower ROF, Size and lack of controlling the projectile once it's been fired.
The first the railgun for personal and vehicle use may be a single use LAW type weapon that would use explosive batteries whose explosive energy would be expelled from the back of the launcher much like a recoilless gun. That would make it impossible for confined use but would be useful for equipping assault infantry and larger examples on the turret sides of AFVs.
As technology progresses the railgun might not even have a power source, it would most likely be attached to the the projectile to form a cartridge and it would be a loaded the same as gunpowder weapons. Once rate of fire expectations become higher the power source would be inbuilt again making ammo lighter. Even later a gatling type railgun with the latter configuration would be introduced but would be cumbersome at first due to the even more massive power required to sustain a high ROF. The latest feature would be the possibility to spin the projectile using moving magnetic fields in the railgun barrel. That would make it more accurate but with less terminal velocity. This would be mostly useful likely as a long range standoff round due to having larger distances to travel than land warfare and thus more time to accelerate to adequate velocity.
In land warfare this wouldn't be necessary since the ranges don't exist to make a difference. Space railguns would be able to interchange the spin and regular mode.