Server in China can't reach rubygems.org so install fails

An error occurred while installing email_reply_trimmer (0.0.6), and Bundler
cannot continue.
Make sure that `gem install email_reply_trimmer -v '0.0.6'` succeeds before
bundling.

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without development' failed with return #<Process::Status: pid 296 exit 5>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
d1702bba1d88ff0da3097b76755409118974ef56618dbf4673348d5a6e812967
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one