Replace rubygems.org with taobao mirror to resolve network error in China

rubygems.org hosts its resource in Amazon S3 which is disturbed by GFW. So gem and bundle complain from time to time.

This guide assumes you used docker installation. This guide also has a version in Chinese. 中文指南

Add a template

Open your congiruation file, say, app.yml.

Add a reference to the china template:

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/sshd.template.yml"
  - "templates/web.template.yml"
  - "templates/web.china.yml"

Bootstrap docker container

Rebuild your app

./launcher rebuild app

Or bootstrap:

./launcher bootstrap app

You are done! Everything should work then.

6 Likes

Thanks for this howto

But i got failed.

I, [2014-11-24T09:53:44.584528 #40]  INFO -- : HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid:67 did not terminate cleanly, forcing termination!
/pups/lib/pups/config.rb:93:in `block (2 levels) in run_commands': Invalid run command cmd (SyntaxError)
from /pups/lib/pups/config.rb:87:in `each'
from /pups/lib/pups/config.rb:87:in `block in run_commands'
from /pups/lib/pups/config.rb:86:in `each'
from /pups/lib/pups/config.rb:86:in `run_commands'
from /pups/lib/pups/config.rb:71:in `run'
from /pups/lib/pups/cli.rb:31:in `run'
from /pups/bin/pups:8:in `<main>'
3aa707b645a27211c38f452718a78d275ac572c018304154c086071ec1be0d15
FAILED TO BOOTSTRAP

@sam Would you please merge this pull request? This is tested.

sorry … merged now.

1 Like

Please update your discourse_docker by git pull origin master and try again.

I think the template file’s path should be “templates/web.china.template.yml”.

1 Like

it looks like this suggestion has been implemented. could you update the original topic so that it reflects the appropriate fix?

2 Likes

Hi @fantasticfears Thanks share this tips. I’m going to self-host Discourse to avoid Discourse-host issue like blocked from access and performance.
Do you know if Discouse source code itself has any service request that blocked by GFW. if it’s does a self-host cannot guarantee the sevice in mainland China.

ps. https://meta.discoursecn.org/t/discourse/28 is not available now.