All you need:
You need 12 magnets (10mm x 10mm x 10mm).
10 for the gun.
2 for the each bullet.
Use neodymium magnets.
I believe it will not work with common magnets, they are not strong enough.
Use the blueprint image to align the magnets.
Align all magnets to same direction, do the same for the bullet.
I got better results with 2 magnets in the bullet, but also worked with 3 and 4.
Use tape to hold everything together.
I believe it should work for any arrangement 45 degrees and with ratio of 1 to 2 between the poles of the rail and the bullets.
Bullet field length 5mm x 4(N-S-N-S) and Rail field length 10mm x 5(N-N-N-N-N).
I found inverted fields configuration for bullets and rail working well too.
Always remembering to centralize the magnetic field in all directions.