Heroku:资产管道错误以显示图像

时间:2019-04-04 01:56:57

标签: ruby-on-rails heroku

我无法解决在“资产/生产中的图像(Heroku)”中显示图像的问题。图像在开发中显示,但仅在生产中无法显示。

ActionView :: Template :: Error(资产管道中不存在资产“ category-1.jpeg”。)

      <%= link_to category do %>
        <div class="categoryItem">
          <div class="image">
            <%= image_tag "category-#{category.id}.jpeg" %>
          </div>
          <div class="name">
            <span><%= category.name %></span>
          </div>
        </div>
      <% end %>

1 个答案:

答案 0 :(得分:0)

您可以通过更新production.rb中的config/environments/production.rb来解决此问题。刚刚设置

config.assets.compile = true
相关问题