title: Heroku Not Showing SCSS Background Images
body: <p>I have a Rails app that uses background images from a <code>style.css.scss</code> file.  I have found multiple ways of having the images show up on <code>localhost</code>, but no ways to get them to display on Heroku. </p>
  
  <p>I have looked at MANY posts on SO like <a href="https://stackoverflow.com/questions/15257555/how-to-reference-images-in-css-within-rails-4">this</a> and <a href="https://stackoverflow.com/questions/19200913/heroku-does-not-serve-background-image-localhost-does?lq=1">this</a>, as well as other sites like <a href="https://www.natashatherobot.com/rails-4-heroku-assets-not-found-css-image/" rel="nofollow noreferrer">this</a>, but nothing has worked so far.</p>
  
  <p>Here is the code I have in my <code>style.css.scss</code>:</p>
  
  <pre><code>.hero-000 {
      width: 102%;
      background: url(asset-path("hero-000.jpg")) no-repeat center center fixed;
      -webkit-background-size: cover;
      -moz-background-size: cover;
      -o-background-size: cover;
      background-size: cover;
  }
  </code></pre>
  
  <p>However, I have also tried <code>background-image</code>, <code>image-url</code>, <code>asset-url</code>, and numerous other permutations as found in the linked SO posts.</p>
  
  <p>I have this in my <code>production.rb</code> file:</p>
  
  <pre><code>  config.serve_static_files = true
    config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
    config.assets.compile = true
    config.assets.digest = true
  </code></pre>
  
  <p>And this in my <code>application.html.erb</code> file to call the css sheet:</p>
  
  <pre><code>  &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
  </code></pre>
  
  <p>As suggested by other posts, I have added this to my application.rb:</p>
  
  <pre><code>config.assets.initialize_on_precompile = false
  </code></pre>
  
  <p>Any ideas on how this can be resolved would be happily received!</p>
  
  <p>ADDITIONAL INFO</p>
  
  <p>Here's my gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails', '4.2.5'
  
  group :production do
    gem 'pg'
    gem 'rails_12factor'
  end
  
  group :development do
    gem 'sqlite3'
    gem 'binding_of_caller'
    gem 'better_errors'
  end
  
  gem 'sass-rails', '~&gt; 5.0'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'coffee-rails', '~&gt; 4.1.0'
  gem 'jquery-rails'
  gem 'turbolinks'
  gem 'bcrypt', '~&gt; 3.1.7'
  gem 'bootstrap-sass'
  gem 'friendly_id', '~&gt; 5.1.0'
  gem 'google-analytics-rails', '1.1.0'
  gem 'paperclip'
  gem 'meta-tags'
  gem 'bootsy'
  gem 'devise'
  </code></pre>
  
  <p>Here are my console errors in localhost:
  <a href="https://i.stack.imgur.com/DEVhG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DEVhG.png" alt="enter image description here"></a></p>
  
  <p>And in Heroku:
  <a href="https://i.stack.imgur.com/1AkEV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1AkEV.png" alt="enter image description here"></a></p>