I'm trying to use gsub to put escapes before single quotes.

irb(main):001:0> a = "Ain't Can't"
=> "Ain't Can't"
irb(main):002:0> a.gsub(/(\')/, '\\1')
=> "Ain't Can't"
irb(main):003:0> a.gsub(/(\')/, '\\\1')
=> "Ain\\1t Can\\1t"
irb(main):004:0> a.gsub(/(\')/, '\\\\1')
=> "Ain\\1t Can\\1t"
irb(main):005:0> a.gsub(/(\')/, '\\\\\1')
=> "Ain\\'t Can\\'t"
irb(main):006:0>

How does one do it?