Home>

Please write your question in detail here.
After auto-deploying, uploading to master on Github,
CSS disappeared when auto-deploying on EC2.

[[email protected] nostalgia] $sudo less /var/log/nginx/error.log
2020/11/16 07:37:24 [error] 29011 # 0: * 555 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/"
2020/11/16 07:37:32 [error] 29011 # 0: * 555 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/"
2020/11/16 07:37:34 [error] 29011 # 0: * 557 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/"
2020/11/16 07:38:09 [error] 29011 # 0: * 555 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/"
2020/11/16 07:38:36 [error] 29011 # 0: * 557 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/items"
2020/11/16 07:38:44 [error] 29011 # 0: * 555 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/items"
2020/11/16 07:38:55 [error] 29011 # 0: * 557 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/items"
2020/11/16 07:40:11 [error] 29011 # 0: * 584 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/items"
2020/11/16 07:41:12 [error] 29011 # 0: * 585 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/users/1"
2020/11/16 07:41:34 [error] 29011 # 0: * 584 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/"
2020/11/16 07:41:37 [error] 29011 # 0: * 585 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
ch file or directory), client: 103.5.140.149, server: 54.248.24.69, request: "GET/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css HTTP/1.1",
 host: "54.248.24.69", referrer: "http://54.248.24.69/"
2020/11/16 07:42:20 [error] 29011 # 0: * 584 open () "/ var/www/nostalgia/public/assets/application-bd27d8a19976d1f442130770741a52ef0e54af51b09d239d898a2c593a0957ab.css" failed (2: No su
There were too many, so the rest are screenshots
https://gyazo.com/abdca666a20d3bbd142b152260e832b8
Corresponding source code
@ -445,11 +445,11 @@ i {
  transition-timing-function: ease-in;
}
/ * .button {
.button {
  background-image: -moz-linear-gradient (top, rgba (255, 255, 255, 0.05) 1%, rgba (0, 0, 0, 0.2) 100%);
  background-image: -webkit-linear-gradient (top, rgba (255, 255, 255, 0.05) 1%, rgba (0, 0, 0, 0.2) 100%);
  background-image: linear-gradient (to bottom, rgba (255, 255, 255, 0.05) 1%, rgba (0, 0, 0, 0.2) 100%);
} * /
}
ul {
  margin: 0;
@ -648,16 +648,9 @@ body {h1,
h2,
h3,

h4,
body {
  text-align: center;
  color: # 666;
  font-size: 18px;
}

h5,
h6,
body {
  line-height: 1.57;
  letter-spacing: 0.15em;
@ -665,26 +658,8 @@ body {
  color: # 666;
  font-family:'Unica One', "Avenir", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic Pro W6", "HIragino Kaku Gothic Pro", Osaka, Meiryo, " Meiryo "," MS P Gothic "," MS P Gothic ", sans-serif;
  margin: 0;
  text-align: center;
}
h5,
body {
  font-size: px;
  color: # 666;
  margin: 0;
  text-align: center;
}

h6,
body {
  margin: 50px 100px;
  text-align: left;
}

a {
  text-decoration: none;
  color: # 666;
@ -707,9 +682,9 @@ div.contents.row div.content_post p {
  font-size: 2em! important;
}
/ * :: selection {
:: selection {
  background: # D8D8D8;
} * /
}
.transition,
a,
@ -751,7 +726,7 @@ header.header div.header__bar.row div.grid-6 a.post: hover {
}
.title--big {
  font-size: 2.5em;
  font-size: 1.5em;
  font-weight: bold;
}@ -847,10 +822,10 @@ header.header .user_nav ul li a {
  border-bottom: 1px solid # d8d8d8;
}
/ * .form {
.form {
  background-size: cover;
} * /
}
.form .contents {
  position: absolute;
@ -885,16 +860,14 @@ div.contents.row .new_user {
div.contents.row div.content_post {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  position: relative;
  height: 400px;
  color: #fff;
 /* background-size: cover;
  background-position: center center;* /
  background-size: cover;
  background-position: center center;
  border-radius: 3px;
 /* box-shadow: 0 0 10px rgba (41, 41, 41, 0.2);* /
  box-shadow: 0 0 10px rgba (41, 41, 41, 0.2);
}
div.contents.row div.content_post: after {
@ -1091,17 +1064,4 @@ footer p {
 /* object-fit: contain;* /
 /* background: cover;* /
  max-height: 100%;
}
 .a {
  font-size: 3em;
  letter-spacing: -2px;
  margin-bottom: 30px;
  text-align: center;
}
.p {
  font-size: 1.1em;
  line-height: 1.7em;
  margin: 0 0 10px;
What I tried

When I open the IP address, the CSS is not displayed and
Once, kill what is up in ps aux | grep unicorn on EC2,
RAILS_SERVE_STATIC_FILES = 1 unicorn_rails -c config/unicorn.rb -E Start with production -D, do bundle exec cap production deploy locally,
I opened the IP address again, but the result did not change.

Supplementary information (FW/tool version, etc.)

There was no problem in the local environment, and the website was able to start.

Website screenshot
https://gyazo.com/2661a271f9bd7df9941ea37f6e8b9577

  • Answer # 1

    The cause cannot be determined, but
    When you deploy CSS, press command + z to restore it.
    After auto-deploying, I succeeded in opening the WEB application without any problem.
    I'm sorry for making a noise.