箱のプログラミング日記。

えんじにあ奮闘記

NameError: uninitialized constant Annotateの対処法

Railsで発生したエラーの対処法。

NameError: uninitialized constant Annotate

stagingサーバーに入ってbundleしたときに以下のエラーがでた。

bundle exec rake db:migrate
rake aborted!
NameError: uninitialized constant Annotate

んーーなんだろう。

見たことないエラーだったので少し戸惑い。

解決法

ググったらすぐ同じようなのが出てきました。

Don't forget RAILS_ENV=production in front of CLI commands

おっと。。環境指定するの忘れてただけだった。

bundle exec rake db:migrate RAILS_ENV=staging

これでいけました。

参考

https://github.com/tootsuite/mastodon/issues/6161