Use a Scotchbrite synthetic polishing pad.
You can buy these in automotive supply houses in various "grits" Buy a couple of the finer grits to find one that most closely matches the grained finish on your Ruger. These are the same type of pads as the green pot scrubber pads sold in grocery stores, but finer. The grocery store types are too coarse.
Gently rub the scratches until they are either removed, or if too deep, until they're blended in and not so noticeable. (If they're too deep, STOP, before you ruin it).
After the scratches are repaired, "stroke" the pad in the same direction the original grained finish runs to blend the area in with the original finish.