This instructable shows you how to fix the Stinger R34, although since the concept is generally similar for most spring-powered airsoft guns, you should be able to use this for other guns.
NOTE: Before doing this instructable make sure that the gun is discharged in a safe direction.
UPDATE: I added Step 12 since the super glue didn't do the trick. I recommend you do all the steps for maximum strength.
Step 1: The Tools
You don't need much.
Super Glue --Highly reccomended. Holds great.
Medium screwdriver--For removing screws around the rails
Small screwdriver --For removing screws on the side
Paper clip --For reinforcement, not shown in this instructable
Drill bit --For reinforcement, not shown in this instructable