# 用淘宝镜像替换 rubygems.org 以解决在中国的网络错误

**URL:** <https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988>\
**Category:** Sysadmins\
**Tags:** how-to\
**Created:** [2014年十一月10日 03:08 UTC](https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988 "2014-11-10T03:08:07Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [2014年十一月10日 03:08 UTC](https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988/1 "2014-11-10T03:08:07Z")

</div>

[rubygems.org](http://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. [中文指南](https://meta.discoursecn.org/t/discourse/28)

### 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.

---

_[View the full topic](https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988)._
