# AI 플러그인의 Rake 작업이 작동하지 않음

**URL:** https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607
**Category:** Bug
**Tags:** ai
**Created:** [2월 15, 2025, 4:32오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607 "2025-02-15T16:32:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Yenwod](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yenwod/32/275165_2.png) [@Yenwod](https://meta.discourse.org/u/Yenwod)
#### Post date: [2월 15, 2025, 4:32오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607/1 "2025-02-15T16:32:18Z")

</div>

이 AI 플러그인 rake 작업에 관한 질문을 여기에 올리는 것이 적절하지 않을 수도 있으니 미리 양해 부탁드립니다.

Discourse 앱 컨테이너에서 rake 작업을 실행할 때 `bundle exec` 없이도 문제없이 실행할 수 있지만, AI 관련 작업은 작동하지 않습니다. `bundle exec`를 사용하지 않으면 ruby-progressbar가 없어 AI 임베딩 백필이 실패하고, `bundle exec`를 사용하면 데이터베이스 연결이 없어 실패합니다.

이를 수정하는 방법에 대한 조언을 주실 수 있을까요?

---

<div class="post-metadata">

### Author: ![Yenwod](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yenwod/32/275165_2.png) [@Yenwod](https://meta.discourse.org/u/Yenwod)
#### Post date: [2월 15, 2025, 11:25오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607/2 "2025-02-15T23:25:58Z")

</div>

> [@Yenwod](#):
>
> 이 문제를 수정하는 방법에 대한 조언이 있을까요?

컨테이너에 들어가서 아래 명령을 실행하여 문제를 해결했습니다:

`bundle install --with migrations`

문제는 `rake ai:embeddings:backfill` rake 태스크가 다음을 수행한다는 것입니다:

```ruby
  Parallel.each(topics.all, in_processes: args[:concurrency].to_i, progress: "Topics") do |t|
    ActiveRecord::Base.connection_pool.with_connection do
      vector_rep.generate_representation_from(t)
    end
  end

```

이 코드에는 `ruby-progressbar`가 로드되어야 하지만, Gemfile의 migrations 그룹에 포함되어 있어 무시되고 있습니다.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2월 16, 2025, 10:31오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607/3 "2025-02-16T22:31:17Z")

</div>

@Roman / @Falco 여기서 진행 표시줄을 더 이상 사용하지 않는 게 좋을까요?

---

<div class="post-metadata">

### Author: ![Yenwod](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yenwod/32/275165_2.png) [@Yenwod](https://meta.discourse.org/u/Yenwod)
#### Post date: [2월 16, 2025, 11:11오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607/4 "2025-02-16T23:11:31Z")

</div>

> [@sam](#):
>
> 여기서 진행 바를 사용하지 않는 것이 좋을까요?

참고로, 진행 바에 대한 제 경험은 매우 긍정적이었습니다. 백필(backfill)을 반복해야 하는 상황이 생기면 다시 기꺼이 `bundle install`을 실행할 것 같습니다. 진행 바는 매우 정확한 추정치를 제공했습니다(제 경우, 6년 치 토론에 대해 49분이 소요될 것으로 예상되었습니다). 저는 무엇을 기대해야 할지 정말로 몰랐는데, 이전에 한 번도 해본 적 없는 긴 프로세스가 정상적으로 작동하고 있다는 것을 확인하는 것은 정신적, 감정적으로 큰 안도감이었습니다.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 2, 2025, 2:28오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607/5 "2025-12-02T14:28:06Z")

</div>

백필(job)이 이제 몇 분 만에 수만 개의 토픽 임베딩을 처리할 수 있으므로, rake 태스크를 제거합니다.

> <https://github.com/discourse/discourse/pull/36384>

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 2, 2025, 2:28오후 UTC](https://meta.discourse.org/t/rake-tasks-in-the-ai-plugin-not-working/352607/6 "2025-12-02T14:28:18Z")

</div>


