3
0

More than 3 years have passed since last update.

Herokuにデプロイする際、背景画像が表示されないことの解決

Last updated at Posted at 2021-02-18

概要

背景画像について
local → 表示○
Heroku上 → 表示×

Heroku上で背景画像が表示されないことの解決方法を、本記事では述べています。

バージョン

rubyのバージョン ruby-2.6.5
Railsのバージョン Rails:6.0.0

解決方法

config/environments/production.rbを以下のように書き換える。

(変更前)config.assets.compile = false

(変更後)config.assets.compile = true

config/environments/production.rb

〜省略〜

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = true # =false → trueに変更

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.


〜省略〜


その後、デプロイして背景画像が表示されていれば完了です。

以上です。

3
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0