# Rebake with rails command or rake task doesn't work, but rebuilding HTML does. Why?

**URL:** https://meta.discourse.org/t/rebake-with-rails-command-or-rake-task-doesnt-work-but-rebuilding-html-does-why/220841
**Category:** Self-hosting
**Created:** [March 13, 2022, 2:02pm UTC](https://meta.discourse.org/t/rebake-with-rails-command-or-rake-task-doesnt-work-but-rebuilding-html-does-why/220841 "2022-03-13T14:02:44Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 21, 2022, 5:07pm UTC](https://meta.discourse.org/t/rebake-with-rails-command-or-rake-task-doesnt-work-but-rebuilding-html-does-why/220841/12 "2022-03-21T17:07:44Z")

</div>

> [@Canapin](#):
>
> about the difference(s) between these tasks would be welcome

Rebuild HTML: `post.rebake!(invalidate_oneboxes: true, invalidate_broken_images: true)`

Rake `posts:rebake`: `post.rebake!(**opts)` where opts is generally empty  
For the Oneboxes you can try task `posts:refresh_oneboxes` and for the broken images you can try task `posts:invalidate_broken_images`. The latter might be the solution to your problem.

---

_[View the full topic](https://meta.discourse.org/t/rebake-with-rails-command-or-rake-task-doesnt-work-but-rebuilding-html-does-why/220841)._
