Maybe see Replace rubygems.org with taobao mirror to resolve network error in China
There’s also a China template that you can include. You can see it in the templates folder. I’m not quite sure what it does.
(This isn’t a great answer, but it’s been two days and you don’t have any yet.)