title: Problems with asset pipeline in Heroku: not loading some images and js files in Rails app
body: <p>My app works in the development environment but in Heroku there are some images, fonts, and js functions that aren't working.</p>
  
  <p>I will hone in on one image for now. The homepage should load an image located in </p>
  
  <blockquote>
    <p>assets/images/patterns/blue_pattern.gif</p>
  </blockquote>
  
  <p>In my SCSS file I have:</p>
  
  <pre><code>image-url("patterns/blue_pattern.gif")
  </code></pre>
  
  <p>My Heroku logs contains the following:</p>
  
  <blockquote>
    <p>2017-04-11T10:39:54.873200+00:00 heroku[router]: at=info method=GET
    path="/images/patterns/blue_pattern.gif"
    host=matchmeplease.herokuapp.com
    request_id=cf0c2d58-a616-484f-b659-cd4cbfe94118 fwd="115.70.240.190"
    dyno=web.1 connect=2ms service=5ms status=404 bytes=1789
    protocol=https</p>
  </blockquote>
  
  <p>I will be honest and say I do not fully understand the configuation files.</p>
  
  <p>My config/environments/production.rb file:</p>
  
  <pre><code>Rails.application.configure do
    config.force_ssl = true
    config.cache_classes = true
    config.eager_load = true
    config.consider_all_requests_local       = false
    config.action_controller.perform_caching = true
    config.public_file_server.enabled = false
  
    config.assets.js_compressor = :uglifier
    config.assets.css_compressor = :sass
  
    config.assets.compile = true
  
    config.assets.digest = true
  
    config.log_level = :debug
  
    config.i18n.fallbacks = true
  
    config.active_support.deprecation = :notify
  
    config.log_formatter = ::Logger::Formatter.new
  
    config.active_record.dump_schema_after_migration = false
  
    config.serve_static_assets = true
  end
  </code></pre>
  
  <p>config/application.rb:</p>
  
  <pre><code>require_relative 'boot'
  require 'rails/all'
  require 'geocoder'
  require "geocoder/railtie"
  Geocoder::Railtie.insert
  
  # Require the gems listed in Gemfile, including any gems
  # you've limited to :test, :development, or :production.
  Bundler.require(*Rails.groups)
  
  module MatchMe
    class Application &lt; Rails::Application
      config.assets.paths &lt;&lt; Rails.root.join("app", "assets", "font")
    end
  end
  </code></pre>
  
  <p>EDIT: After following Uday kumar das' comment (see below) I now have images and fonts working, but my js files still aren't loading for some reason.</p>
  
  <p>When I run <code>RAILS_ENV=production bundle exec rake assets:precompile</code> I get the following:</p>
  
  <pre><code>rake aborted!
  ArgumentError: Missing required arguments: aws_access_key_id, aws_secret_access_key
  /usr/local/rvm/gems/ruby-2.3.0/gems/fog-core-1.43.0/lib/fog/core/service.rb:244:in `validate_options'
  /usr/local/rvm/gems/ruby-2.3.0/gems/fog-core-1.43.0/lib/fog/core/service.rb:268:in `handle_settings'
  /usr/local/rvm/gems/ruby-2.3.0/gems/fog-core-1.43.0/lib/fog/core/service.rb:98:in `new'
  /usr/local/rvm/gems/ruby-2.3.0/gems/fog-core-1.43.0/lib/fog/core/services_mixin.rb:16:in `new'
  /usr/local/rvm/gems/ruby-2.3.0/gems/fog-core-1.43.0/lib/fog/storage.rb:27:in `new'
  /usr/local/rvm/gems/ruby-2.3.0/gems/carrierwave-0.11.2/lib/carrierwave/uploader/configuration.rb:83:in `eager_load_fog'
  /usr/local/rvm/gems/ruby-2.3.0/gems/carrierwave-0.11.2/lib/carrierwave/uploader/configuration.rb:96:in `fog_credentials='
  /home/ubuntu/workspace/matchme/config/initializers/carrier_wave.rb:5:in `block in &lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.3.0/gems/carrierwave-0.11.2/lib/carrierwave/uploader/configuration.rb:118:in `configure'
  /usr/local/rvm/gems/ruby-2.3.0/gems/carrierwave-0.11.2/lib/carrierwave.rb:14:in `configure'
  /home/ubuntu/workspace/matchme/config/initializers/carrier_wave.rb:4:in `&lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:648:in `block in load_config_initializer'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in `instrument'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:647:in `load_config_initializer'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:612:in `block (2 levels) in &lt;class:Engine&gt;'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:611:in `each'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:611:in `block in &lt;class:Engine&gt;'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:44:in `each'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
  /home/ubuntu/workspace/matchme/config/environment.rb:5:in `&lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:328:in `require_environment!'
  /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:448:in `block in run_tasks_blocks'
  /usr/local/rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
  /usr/local/rvm/gems/ruby-2.3.0/gems/rake-12.0.0/exe/rake:27:in `&lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
  /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  Tasks: TOP =&gt; environment
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>I'm not sure why this is because my AWS S3 function works perfectly fine in my app.</p>