[RAILS] About the problem that the image is not displayed after AWS deployment

When I access the production environment, there is no CSS. .. .. I will leave a memorandum of my solution that I solved at that time. Image location is app / assets / images

Solution 1 Add .SCSS to the end of the CSS file extension

But that didn't help. I hear that some people have been able to do this much.

Solution 2 Review the CSS.SCSS notation

In my case, the notation is

url(/assets/Image name);


It was

image-url("Image name");


After changing to

$ git pull origin master

Reflect with. But this still doesn't apply

Solution 3 Recompile

https://qiita.com/yoheism42/items/dcf71691ca3e8dfc26c5 Refer to the article here

$ find app/assets/ -type f -exec touch {} \;
$ rake assets:clobber assets:precompile
$ RAILS_ENV=production rake assets:precompile

Try. Then with the command on the second line

========================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
========================================

Such an error. Against this

Then try the three lines of commands from the beginning again. Then this time it went smoothly without being played.

Finally

$ sudo systemctl start nginx
$ sudo systemctl reload nginx

Execute in the order of and restart the engine X

afterwards

$ ps aux | grep unicorn
$kill 1376 ← The number on the far left of the unicorn master line
$ RAILS_SERVE_STATIC_FILES=1 unicorn_rails -c config/unicorn.rb -E production -D

I managed to display the image with this.

It was long···

Recommended Posts

About the problem that the image is not displayed after AWS deployment
[Rails] About the error that the image is not displayed in the production environment
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
[Rails] About the problem that the video thumbnail automatically created by FFmpeg is not displayed [AWS S3 + EC2 + CarrierWave + Fog]
What to do if the background image is not applied after deployment
Solved the problem that profile and logout were not displayed on the screen after signup.
[Android Studio] About the matter that the design view is not displayed when using TextClock
rails AWS deployment is not reflected
About the solution to the problem that the log of logback is not output when the web application is stopped
Image is not displayed in production environment
About the problem that the server can not be started with rails s
The devise error message is not displayed properly.
GoogleMap is not displayed until the browser is reloaded
When the project is not displayed in eclipse
I want to solve the problem that JS is not displayed properly unless reloaded when transitioning with Turbolinks: link_to
[Error] The app is not displayed in the production environment
Use cryptographically secure pseudo-random numbers to verify that the solution to the Monty Hall problem is not 50%
[Rails] The problem that pry-byebug does not stop through breakpoints
Solved the problem that all the data in the table was displayed
[Rails] Solving the problem that session timeout does not work
[Rails] fields_for is not displayed
How to solve the problem that you can not pull image from docker hub with Minikube
[Firebase] The problem that the currentUser of Firebase Auth does not become null even if the app is uninstalled.
How to fix the problem that Aptana Studio does not start
Solved the problem that the scroll event did not fire in JQuery
How to solve the problem that it is not processed normally when nesting beans in Spring Batch
[Rails] How to solve the problem that the default image is overwritten when editing without uploading the image [Active Storage]
that? WebView (swift) is not working.
The problem that the contents of params are completely displayed in the [Rails] view
Where can I find out about Java releases after February 2019? About the problem
[Cloud9] Yay! You ’re on Rails! Is not displayed in the rails tutorial
[Rails] What to do when the Refile image is not displayed when writing the processing at the time of Routing Error
After verifying the Monty Hall problem with Ruby, a story that I could understand well and did not understand well