[RUBY] What to do if the background image is not applied after deployment

Background of writing this article

The background image is not displayed after deploying! When I looked it up, there were quite a few people like that.

Implementation environment

macOS Catalina 10.15.7 VS Code 1.50.0 Ruby 2.6.5 Rails 6.0.0 Server: AWS EC2 WEB server: Nginx Application server: unicorn 5.4.1

approach

I was able to do this. After deployment, the background image will be displayed on the application etc. that went up to production.

① Store the background image in the "/ app / assets / images" folder

(2) Set the CSS type for specifying the background image to "SCSS".

③ CSS description to specify the background image "background-image: image-url (" image name ");"

scss


/*Example*/
body { 
  background-image: image-url("wallpaper.jpg ");
}

Recommended Posts

What to do if the background image is not applied after deployment
[Ubuntu 20.04] What to do if the external monitor is not recognized
What to do if changes are not reflected after automatic deployment to EC2
What to do if the prefix c is not bound in JSP
[Swift] What to do if the app icon is set but not reflected
What to do if audio is not available on discordrb
What to do if FacesMessage is set but not displayed
What to do if the update does not take effect after deploying Rails AWS
What to do if the breakpoint is shaded and does not stop during debugging
About the problem that the image is not displayed after AWS deployment
[Rails] What to do if data is not registered in DB
What to do if Cloud9 is full in the Rails tutorial
What to do if the Eclipse Maven dependency Jar is wrong
[IOS] What to do when the image is filled with one color
What to do if the server tomcat dies
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do if deployment fails on Heroku (Ruby app not detected)
What to do if the app is not created with the latest Rails version installed when rails new
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if Operation not permitted is displayed when you execute a command in the terminal
[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem
What to do if the changes are not reflected in the jar manifest file
What to do if the debug gem installation fails
What to do if the Rails server can't start
What to do if the JSONHint annotation does not work with lombok and JSONIC
What to do if the adb command cannot be executed
What to do if you can't use the rails command
What to do if you installed Ruby with rbenv but the version does not change
What to do after Vagrant install
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
What to do if validation doesn't work with the update action
What to do when the changes in the Servlet are not reflected
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
[Logback] What to do if unnecessary files do not disappear during rotation
What to do if you forget the root password in CentOS7
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails carrier wave] How to not transition to the error screen even if the image upload is not selected
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
What to do about the "cannot be read or is not a valid ZIP file" error
What to do if you get "Changes not staged for commit:" when you git status after git add.
What to do when javax.el.ELException: Not a Valid Method Expression: appears when the JSF screen is displayed
What to do if the log using JUL is no longer output to the app log after deploying the Spring Boot app to Tomcat as a war
What to do after updating Dockerfile, docker-compose.yml
What to do if you install Ubuntu
What to do when "npm ERR! Code ENOSELF" is displayed after npm install
What to do if you can't install the plugin from the Eclipse marketplace
What to do if you don't like the code generated by swagger-codegen-cli
What to do if tomcat process remains when tomcat is stopped in eclipse
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
[Gradle] [checkstyle] What to do if the active setting of Checkstyle is removed by "Refresh Gradle project" from Eclipse
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you get Could not locate Gemfile or .bundle / directory
What to do if you get the error message unrecognized selector send to instance "***"
What to do when rails db: seed does not reflect in the database
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do immediately after introducing Material Design
What to do if you get Could not save master table to file after importing a project in Eclipse
[Grails] Error occurred running What to do when the Grails CLI does not start
What to do if you push incorrect information
What to do if mvn archetype: generate fails
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`