# Rake db:migrate should LOAD\_PLUGINS by default

**URL:** https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151
**Category:** Development
**Created:** [October 14, 2020, 6:48am UTC](https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151 "2020-10-14T06:48:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [October 14, 2020, 6:48am UTC](https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151/1 "2020-10-14T06:48:45Z")

</div>

We at Pavilion have had issues running/debugging tests and saw errors with the poll plugin while running tests. We use to think its some issue with the plugin itself but its not.

The issue was that the migrations of poll plugin hadn’t run. Running `RAILS_ENV=test rake db:migrate LOAD_PLUGINS=1` fixed it.

Just wondering that the rake task should LOAD\_PLUGINS as a default?

---

<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: [October 14, 2020, 7:08am UTC](https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151/2 "2020-10-14T07:08:55Z")

</div>

We already do that here:

> <https://github.com/discourse/discourse/blob/main/bin/rake>

Be sure to use the binstubs, they are faster as well.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [October 14, 2020, 7:17am UTC](https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151/3 "2020-10-14T07:17:16Z")

</div>

> [@sam](#):
>
> Be sure to use the binstubs, they are faster as well.

Thanks for the tip. binstubs are super cool. I’ve read you say this somewhere but didn’t realize the utility of that.  
Do you think monkey patching the task is taking things too far?

---

<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: [October 14, 2020, 7:18am UTC](https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151/4 "2020-10-14T07:18:31Z")

</div>

Yeah I prefer just to keep it as is for now, `bundle exec rake` is slower and a lot longer to type. Using rake without bundler is risky.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [October 14, 2020, 7:19am UTC](https://meta.discourse.org/t/rake-db-migrate-should-load-plugins-by-default/167151/5 "2020-10-14T07:19:20Z")

</div>

> [@sam](#):
>
> Using rake without bundler is risky.

Ah, I didn’t realize that. I’ll read up on this.
