I had a tutorial how to do this on the Crosman forum but it's gone now as are many others.
I got hold of a Picatinny rail that happened to have the holes in the right spot on my second one. Was not so lucky on the first one so just drilled the holes in the rail where I needed them.
I used a larger screw up front and had to drill and tap as the threads in the gun were not so good. But you can use one that is the original size if yours is in good shape. It will need to be longer according to the thickness of your rail though. Take it to the hardware store to get the right size. You may also have to use a washer depending on the size of the head on your screw.
I also stuck a piece of an o-ring down the hole so it sits on the barrel and the screw tightens on it. That way I did not have to get the screw the perfect length to tighten on the rail and barrel at the exact same time like I did on the first gun.
I opened up the hole, to the rear of the barrel screw, so I was able to get at the loading gate to clear any jams. I also notched the bottom of the rail so the loading, second pic, gate would clear the rail. The notch is a little overdone on this one.
The threads in the screw holding the rear sight were good so I was able to just find a slightly longer screw to use there. Although as you can see I had to use a modified washer, filed flat on two sides to install the rail.
Notched the rail above the loading gate as this one needed it.