An electromagnetic railgun has the potential to launch cargo to orbit around the Moon. 
A 10 megajoule railgun test launched a projectile at 2490 meters per second. Escape velocity from the lunar surface is only 2400 meters per second, so more than enough power has been demonstrated to launch projectiles from Luna to L2 electrically.
Adjusting for Lunar Conditions
Making a railgun work on Luna has both advantages and disadvantages. Naturally having to ship the device from Earth or build the industry on Luna to build the railgun is an obvious difficulty. There is also the problem of dealing with high voltages in a vacuum. High pressure gas around electrodes acts as an electrical insulator. The decreased quality of insulation would need to be taken into account in a lunar design. The same vacuum is also a great advantage. The big clouds of smoke following the projectile in photographs of the 2490 meter per second test on Earth would not be a problem on Luna.
Since the purpose on Luna would be putting cargo in orbit or putting it at L2, instead of shelling enemy installations as was the goal of the Navy test, there would need to be some sort of guidance. A homing beacon at L2 with a receiver on a cargo carrier launched by railgun should do. There would need to be the associated thrusters to make the fine adjustments to match velocity with the L2 station. One can guess that a 10 kilogram projectile might be a practical size. That is a 314% increase over the 7 pound slug launched in the Navy test.
Other considerations for lunar use are repetition rate and maintenance. For the goal of developing artillery on earth a high firing rate is also a figure of merit, but development has not gone beyond a single firing followed by considerable study and maintenance before another. There have been railguns built as experiments that required rebuilding between one test and another. On Luna firing every one or two minutes might be sufficient for economic cargo transport. The means of supporting the projectile in the proper position between the rails during firing should not involve sliding of one surface against another.