Both will serve you well, so I don't think you're making a mistake with either.
Overall having shot both (but the 9mm versions thereof), I think the Ruger is the better gun, and a better value. It feels better in the hand, the sights are better, and its just as reliable. AND it costs less.
That said, as has already been mentioned Glock magazines are cheaper (particularly used Glock 22 mags as there's lots of LE surplus out there) so if you want to add a lot of magazines then the Glock may balance out on cost. I try to keep 5 mags for most of my pistols but 2 may be all you need.
Again though, I'd stress that neither of these guns is a "bad" pistol, so whichever you get shoot it and enjoy it without looking back.