0
0

More than 3 years have passed since last update.

アセットプリコンパイル時のuninitialized constantのエラー

Posted at

はじめに

今回のエラーの解決策は至ってシンプルであり、凡ミスでもあったが、
今後忘れないよう、自分への備忘録として記録しておきます。

状況

・Herokuへのデプロイ時にアセットプリコンパイルがうまくいかない。
・GemのDeviseの実装テスト中

原因から解決まで

アセットプリコンパイルを実施。

rails assets:precompile RAILS_ENV=production

以下エラー文が発生。

NameError: uninitialized constant Devise

Deviseの読み込みがうまくいっていないとのこと。

Gemfile
group :development, :test do
gem 'devise'
end

Gemfileのテスト環境位置にgem 'devise'を記入した状態でしかbundle installしていなかったので、本番環境に位置に変更してbundle installでOK。

経験値が少なすぎるからかなかなか気づけませんでした。。。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0