# 重建失败，模板丢失

**URL:** <https://meta.discourse.org/t/rebuild-failing-templates-missing/209576>\
**Category:** Support\
**Tags:** unsupported-install\
**Created:** [2021年十一月18日 22:20 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576 "2021-11-18T22:20:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![OverseersMight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overseersmight/32/228719_2.png) [@OverseersMight](https://meta.discourse.org/u/OverseersMight)\
**Post date:** [2021年十一月18日 22:20 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/1 "2021-11-18T22:20:07Z")

</div>

我收到以下错误

```plaintext
cat: templates/postgres.template.yml: No such file or directory
cat: templates/redis.template.yml: No such file or directory
cat: templates/web.template.yml: No such file or directory
cat: templates/web.ratelimited.template.yml: No such file or directory
cat: templates/web.ssl.template.yml: No such file or directory
cat: templates/web.letsencrypt.ssl.template.yml: No such file or directory

```

每次我重建时，我的实例就无法运行了，我该如何恢复它？

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2021年十一月18日 22:31 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/2 "2021-11-18T22:31:21Z")

</div>

您似乎以某种方式删除了 templates 目录？

如果您有最近的备份，最稳妥的解决方案是重新安装并恢复备份。如果没有，很难在这里猜测问题可能是什么。

您在另一个主题中删除了有用的信息。

> [@](#):
>
> ~~I~~~~ just ~~~~recently~~~~ moved ~~~~it~~~~ to ~~~~a~~~~ new ~~~~directory~~~~ , ~~~~but~~~~ I ~~~~already~~~~ redirected ~~~~app~~~~ yml ~~~~to~~~~ the ~~~~correct~~~~ path ~~~~.~~

不要那样做。将其移回 `/var/discourse`。

如果您想将其移到其他地方，那将自行负责。

---

<div class="post-metadata">

**Author:** ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)\
**Post date:** [2021年十一月18日 23:45 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/3 "2021-11-18T23:45:42Z")

</div>

> [@OverseersMight](#):
>
> 我该如何恢复它？

将所有文件和目录移回原位。  
你不能随意移动文件和目录。

---

<div class="post-metadata">

**Author:** ![OverseersMight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overseersmight/32/228719_2.png) [@OverseersMight](https://meta.discourse.org/u/OverseersMight)\
**Post date:** [2021年十一月19日 16:04 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/4 "2021-11-19T16:04:31Z")

</div>

我找到了解决方案，如果您编辑 app.yml 源文件，就可以更改 discourse 的目录（我之前将其放在了不同的卷上。我最终只是备份了它，并在编辑后的目录中创建了一个新实例，然后上传了备份。

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2021年十一月19日 16:08 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/5 "2021-11-19T16:08:51Z")

</div>

在雪道外滑雪时要格外小心。您在这里获得的支援会较少，因为这会增加提供支援的难度。

---

<div class="post-metadata">

**Author:** ![OverseersMight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overseersmight/32/228719_2.png) [@OverseersMight](https://meta.discourse.org/u/OverseersMight)\
**Post date:** [2021年十一月19日 16:13 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/6 "2021-11-19T16:13:35Z")

</div>

它的工作方式完全相同，甚至在 app.yml 文件中也得到了支持。移动它有点冒险，这是唯一不好的地方，但在另一个目录中创建实例是完全支持的。

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2021年十一月19日 16:14 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/7 "2021-11-19T16:14:07Z")

</div>

我希望你能在下一个用户就该话题来到 #Support 时加入讨论 😉

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2021年十一月19日 20:42 UTC](https://meta.discourse.org/t/rebuild-failing-templates-missing/209576/8 "2021-11-19T20:42:21Z")

</div>

> [@OverseersMight](#):
>
> it’s even supported in the app.yml file. Moving it was a little risky and that was the only bad part, but creating an instance in another directory is compl

就我们在此提供的免费支持而言，我们只能协助进行[标准安装](https://github.com/discourse/discourse/blob/f971ecd2316cfb62d164068deaa7b51587fa2cd7/docs/INSTALL-cloud.md)，该安装使用 /var/discourse。

开源的乐趣在于，是的，你可以随心所欲地进行自定义，但同样，这也将严重限制我们能为你提供的帮助。

由于是基于 docker 的，因此无需在其他目录中创建实例，你可以通过定义单独的容器从同一路径运行多个配置。
