SCSS doesn't work when deploying Rails6 AWS

Introduction

When I deployed with rails6, scss didn't work and I was worried a lot, so I wrote an article. Since I am a beginner, I think there are some mistakes, but please forgive me.

environment

ruby 2.6.5 rails 6.0.0 'sass-rails', '~> 5' 'webpacker', '~> 4.0'

error contents

Scss works fine locally, but it doesn't work in production.

local image.png

Production environment image.png

The function of full calender works like this, but I was having a problem that looked strange.

Solutions

Before correction

webpacker.yml


extract_css: true

Edited

webpacker.yml


extract_css: false

It was solved by setting extract_css to false in this way.

I used scss instead of css, so It seems that the error occurred because I went to look for .css by default but could not find it.

Reference site

https://ja.stackoverflow.com/questions/66709

Recommended Posts

SCSS doesn't work when deploying Rails6 AWS
[Beginner] When rails s doesn't work
When PyCall doesn't work with PyCall :: PythonNotFound
Breakpoint doesn't work when running Rails Minitest in Ruby Test Explorer
Check when nvidia-smi on Ubuntu doesn't work
[heroku] run rails db: migrate doesn't work
[Personal memo] Summary of stumbling blocks when deploying Rails apps to AWS
rails generate doesn't work at all! Sometimes try
Recipe for deploying Rails apps on AWS EC2
Things to check when it doesn't work with proguard
Error encountered with notes when deploying docker on rails
When the vagrant command doesn't work for some reason
Error when deploying EC2
Rails server doesn't start.
[Ruby on Rails] When parameter id acquisition does not work
Summary of initial work when creating an app with Rails