railsでのActionView::Template::Errorについて

railsでサイトの制作中です。
今サイトを開くと下記のエラーになります。

We're sorry, but something went wrong.
If you are the application owner check the logs for more information.

heroku logsでログを確認すると下記のようになりました。

show.html.erbのファイルの13行目に問題があるようです。
しかしどこが問題なのかわかりません。

一応コントローラも載せました。

2022-07-27T09:17:24.688214+00:00 app[web.1]: F, [2022-07-27T09:17:24.688179 #4] FATAL -- : [a33d723e-2f48-4000-ab3d-a4f9d37907bf]
2022-07-27T09:17:24.688215+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] ActionView::Template::Error (ActiveStorage::FileNotFoundError):
2022-07-27T09:17:24.688215+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 10: <div class="carousel-inner">
2022-07-27T09:17:24.688230+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 11: <% @product.images.each_with_index do |image, i| %>
2022-07-27T09:17:24.688231+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 12: <div class="item <%= "active" if i.zero? %>" data-thumb=<%= i %>>
2022-07-27T09:17:24.688231+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 13: <%= image_tag image.attachment(:large) %>
2022-07-27T09:17:24.688232+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 14: </div>
2022-07-27T09:17:24.688232+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 15: <% end %>
2022-07-27T09:17:24.688232+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] 16: </div>
2022-07-27T09:17:24.688233+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf]
2022-07-27T09:17:24.688233+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] app/views/potepan/products/show.html.erb:13
2022-07-27T09:17:24.688233+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] app/views/potepan/products/show.html.erb:11:in `each_with_index'
2022-07-27T09:17:24.688236+00:00 app[web.1]: [a33d723e-2f48-4000-ab3d-a4f9d37907bf] app/views/potepan/products/show.html.erb:11
2022-07-27T09:17:24.689133+00:00 heroku[router]: at=info method=GET path="/potepan/products/1" host=cryptic-plains-88458.herokuapp.com request_id=a33d723e-2f48-4000-ab3d-a4f9d37907bf fwd="126.140.195.172" dyno=web.1 connect=0ms service=373ms status=500 bytes=1669 protocol=https

products_controller.rb

class Potepan::ProductsController < ApplicationController def show @product = Spree::Product.find(params[:id]) end end

application_controller.rb

class ApplicationController < ActionController::Base include ActiveStorage::SetCurrent protect_from_forgery with: :exception end

show.html.erb

<% provide(:title, @product.name) %> <%= render 'light_section', product_name: @product.name %> <section class="mainContent clearfix"> <div class="container"> <div class="row singleProduct"> <div class="col-xs-12"> <div class="media"> <div class="media-left productSlider"> <div id="carousel" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <% @product.images.each_with_index do |image, i| %> <div class="item <%= "active" if i.zero? %>" data-thumb=<%= i %>> <%= image_tag image.attachment(:large) %> </div> <% end %> </div> </div> <div class="clearfix"> <div id="thumbcarousel" class="carousel slide" data-interval="false"> <div class="carousel-inner"> <% @product.images.each_with_index do |image, i| %> <div data-target="#carousel" data-slide-to=<%= i %> class="thumb"> <%= image_tag image.attachment(:small) %> </div> <% end %> </div> <a class="left carousel-control" href="#thumbcarousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#thumbcarousel" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div> <div class="media-body"> <ul class="list-inline"> <li><a href="product_grid_left_sidebar.html"><i class="fa fa-reply" aria-hidden="true"></i>一覧ページへ戻る</a></li> </ul> <h2><%= @product.name %></h2> <h3><%= @product.display_price %></h3> <p><%= @product.description %></p> <span class="quick-drop"> <select name="guiest_id3" id="guiest_id3" class="select-drop"> <option value="0">S</option> <option value="1">M</option> <option value="2">L</option> <option value="3">XL</option> </select> </span> <span class="quick-drop resizeWidth"> <select name="guiest_id4" id="guiest_id4" class="select-drop"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </span> <div class="btn-area"> <a href="cart_page.html" class="btn btn-primary btn-block">カートへ入れる<i class="fa fa-angle-right" aria-hidden="true"></i></a> </div> </div> </div> </div> </div> <div class="row productsContent"> <div class="col-xs-12"> <div class="page-header"> <h4>関連商品</h4> </div> </div> <div class="col-md-3 col-sm-6 col-xs-12"> <div class="productBox"> <div class="productImage clearfix"> <%= image_tag("img/products/products-01.jpg", :alt => "products-img") %> </div> <div class="productCaption clearfix"> <h5>Nike Sportswear</h5> <h3>199円</h3> </div> </div> </div> <div class="col-md-3 col-sm-6 col-xs-12"> <div class="productBox"> <div class="productImage clearfix"> <%= image_tag("img/products/products-02.jpg", :alt => "products-img") %> </div> <div class="productCaption clearfix"> <h5>Dip Dyed Sweater</h5> <h3>249円</h3> </div> </div> </div> <div class="col-md-3 col-sm-6 col-xs-12"> <div class="productBox"> <div class="productImage clearfix"> <%= image_tag("img/products/products-03.jpg", :alt => "products-img") %> </div> <div class="productCaption clearfix"> <h5>Scarf Ring Corner</h5> <h3>179円</h3> </div> </div> </div> <div class="col-md-3 col-sm-6 col-xs-12"> <div class="productBox"> <div class="productImage clearfix"> <%= image_tag("img/products/products-04.jpg", :alt => "products-img") %> </div> <div class="productCaption clearfix"> <h5>Sun Buddies</h5> <h3>149円</h3> </div> </div> </div> </div> </div> </section>

コメントを投稿

0 コメント