DockerでRailsの開発環境を構築したのですが、Bootstrap4の導入でハマったため投稿します。
公式サイトの手順に沿ってインストール
まず以下の公式サイトに従って導入しました。
Bootstrap4
エラー発生
ActionView::Template::Error (Autoprefixer doesn’t support Node v4.8.2. Update it.):
AutoprefixerがNode v4.8.2のサポートしていないため、updateしてくださいエラー。
大人しくアップデートするか、もしくは以下のgemをGemfileに追記。
Gemfile
gem 'mini_racer'
bundle installを実行。
またエラー発生
ActionView::Template::Error (File to import not found or unreadable: bootstrap.
bootstrapを読み込めないというエラー。
bundle installを実行しているのになぜだろうとログを見ていると、
何回実行してもinstalling bootstrap4が走っている。
これキャッシュ関係してるとかある・・・?と疑問に思い調べてみました。
以下を実行し、エラーは解消できました。
docker-compose build --no-cache
めでたくbootstrap4導入完了
アプリ画面を確認するとちゃんとbootstrapがちゃんと反映されていました!
調べている最中は悔しい気持ちでいっぱいになるのに、
なんだかんだずっと続けられるのは、達成した喜びがあるからかなと改めて感じました。