# Fail to rebuild and got 502 Bad Gateway

**URL:** https://meta.discourse.org/t/fail-to-rebuild-and-got-502-bad-gateway/68390
**Category:** Self-hosting
**Created:** [8월 19, 2017, 5:42오후 UTC](https://meta.discourse.org/t/fail-to-rebuild-and-got-502-bad-gateway/68390 "2017-08-19T17:42:10Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [8월 20, 2017, 12:52오후 UTC](https://meta.discourse.org/t/fail-to-rebuild-and-got-502-bad-gateway/68390/4 "2017-08-20T12:52:32Z")

</div>

Hi, you asked for the whole message

[total\_message.txt.gz](https://global.discourse-cdn.com/meta/original/3X/5/6/56c76096d1a4609f8b9fe6b8dd8112e55522715e.gz) (46.9 KB)

@codinghorror

and I found a very similar problem which was caused by the source of ruby china.

> [@Failed to rebuild Discourse with the following information](https://meta.discourse.org/t/failed-to-rebuild-discourse-with-the-following-information/48386):
>
> ./launcher rebuild app returns: FAILED -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without development' failed with return #\<Process::Status: pid 312 exit 7\> Location of failure: /pups/lib/pups/exec\_command.rb:108: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 discours…

---

_[View the full topic](https://meta.discourse.org/t/fail-to-rebuild-and-got-502-bad-gateway/68390)._
