前提・実現したいこと
ここに質問の内容を詳しく書いてください。
自動デプロイした後、Githubでmasterにアップした後、
EC2で自動デプロイするとCSSが表示されなくなった。
発生している問題・エラーメッセージ
[ec2-user@ip-172-31-45-251 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 多過ぎたので残りはスクリーンショット https://gyazo.com/abdca666a20d3bbd142b152260e832b8
該当のソースコード
stlye.css
1@ -445,11 +445,11 @@ i { 2 transition-timing-function: ease-in; 3} 4 5/* .button { 6.button { 7 background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.05) 1%, rgba(0, 0, 0, 0.2) 100%); 8 background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.05) 1%, rgba(0, 0, 0, 0.2) 100%); 9 background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1%, rgba(0, 0, 0, 0.2) 100%); 10} */ 11} 12 13ul { 14 margin: 0; 15@ -648,16 +648,9 @@ body { 16h1, 17h2, 18h3, 19 20 21h4, 22body { 23 text-align: center; 24 color: #666; 25 font-size: 18px; 26} 27 28 29h5, 30h6, 31body { 32 line-height: 1.57; 33 letter-spacing: 0.15em; 34@ -665,26 +658,8 @@ body { 35 color: #666; 36 font-family: 'Unica One', "Avenir", "游ゴシック", "YuGothic", "ヒラギノ角ゴ Pro W6", "HIragino Kaku Gothic Pro W6", "HIragino Kaku Gothic Pro", Osaka, Meiryo, "メイリオ", "MS Pゴシック", "MS P Gothic", sans-serif; 37 margin: 0; 38 text-align: center; 39} 40 41h5, 42body { 43 font-size: px; 44 color: #666; 45 46 margin: 0; 47 text-align: center; 48} 49 50 51h6, 52body { 53 margin : 50px 100px; 54 text-align: left; 55} 56 57 58a { 59 text-decoration: none; 60 color: #666; 61@ -707,9 +682,9 @@ div.contents.row div.content_post p { 62 font-size: 2em !important; 63} 64 65/* ::selection { 66::selection { 67 background: #D8D8D8; 68} */ 69} 70 71.transition, 72a, 73@ -751,7 +726,7 @@ header.header div.header__bar.row div.grid-6 a.post:hover { 74} 75 76.title--big { 77 font-size: 2.5em; 78 font-size: 1.5em; 79 font-weight: bold; 80} 81 82@ -847,10 +822,10 @@ header.header .user_nav ul li a { 83 border-bottom: 1px solid #d8d8d8; 84} 85 86/* .form { 87.form { 88 background: url(https://dl.dropboxusercontent.com/u/5840617/DeathtoStock_Wired3.jpg); 89 background-size: cover; 90} */ 91} 92 93.form .contents { 94 position: absolute; 95@ -885,16 +860,14 @@ div.contents.row .new_user { 96 97div.contents.row div.content_post { 98 margin: 20px 0; 99 display: flex; 100 justify-content: center; 101 align-items: center; 102 padding: 30px; 103 position: relative; 104 height: 400px; 105 color: #fff; 106 /* background-size: cover; 107 background-position: center center; */ 108 background-size: cover; 109 background-position: center center; 110 border-radius: 3px; 111 /* box-shadow: 0 0 10px rgba(41, 41, 41, 0.2); */ 112 box-shadow: 0 0 10px rgba(41, 41, 41, 0.2); 113} 114 115div.contents.row div.content_post:after { 116@ -1091,17 +1064,4 @@ footer p { 117 /* object-fit: contain; */ 118 /* background: cover; */ 119 max-height: 100%; 120} 121 122 .a { 123 font-size: 3em; 124 letter-spacing: -2px; 125 margin-bottom: 30px; 126 text-align: center; 127} 128 129.p{ 130 font-size: 1.1em; 131 line-height: 1.7em; 132 margin: 0 0 10px; 133
試したこと
IPアドレスを開くとCSSが表示されず、
一度、EC2でps aux | grep unicornで立ち上がっているものをkillして、
RAILS_SERVE_STATIC_FILES=1 unicorn_rails -c config/unicorn.rb -E production -Dで立ち上げて、ローカル上でbundle exec cap production deployを行い、
再度、IPアドレスを開いたのですが、結果は変わりませんでした。
補足情報(FW/ツールのバージョンなど)
ローカル環境では問題なく、WEBサイトは起動出来ていました。
WEBサイトのスクリーンショット
https://gyazo.com/2661a271f9bd7df9941ea37f6e8b9577
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。