Oops. Sorry. That’s what the g in gsub does! I don’t know what I was thinking.
If you put the puts after the gsub do you see the replacement being done?
Also, what I world do is run the code by hand one line at a time and see if it does what you expect and see if changes made there are affecting the database you’re trying to affect.