# 重建失败 - 跳过 app.yml 中的 "after\_assets\_precompile" 部分

**URL:** <https://meta.discourse.org/t/rebuild-failure-skipping-after-assets-precompile-section-of-app-yml/346414>\
**Category:** Self-hosting\
**Created:** [2025年一月9日 23:01 UTC](https://meta.discourse.org/t/rebuild-failure-skipping-after-assets-precompile-section-of-app-yml/346414 "2025-01-09T23:01:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [2025年一月9日 23:06 UTC](https://meta.discourse.org/t/rebuild-failure-skipping-after-assets-precompile-section-of-app-yml/346414/2 "2025-01-09T23:06:46Z")

</div>

您是否添加了上传资源的 stanza？

[为上传配置 S3 兼容对象存储提供商](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916)

> [@Discourse](#):
>
> ## 配置
> 
> 为了将 Discourse 静态资源存储在您的对象存储中，请在 `app.yml` 的 `hooks` 部分添加此配置：
> 
> ```plaintext
> after_assets_precompile:
> - exec:
> cd: $home
> cmd:
> - sudo -E -u discourse bundle exec rake s3:upload_assets
> - sudo -E -u discourse bundle exec rake s3:expire_missing_assets
> 
> ```

您可以在那里找到该 rake 任务，然后在容器内运行它（以节省重新构建的时间）。然后，在编辑 yml 文件后进行一次重新构建。

---

_[View the full topic](https://meta.discourse.org/t/rebuild-failure-skipping-after-assets-precompile-section-of-app-yml/346414)._
