title: rails - application.css asset not found in production mode
body: <p>I'm upgrading an application to use the asset pipeline.</p>
  
  <p>I've got the css assets compiling into an application css file but they not being found when I run the application in production mode with</p>
  
  <pre><code>RAILS_ENV=production bundle exec rails s
  </code></pre>
  
  <p>and I visit any page I get the correct output from the database but no styling and the log shows:</p>
  
  <pre><code>ActionController::RoutingError (No route matches [GET] 
  "/assets/default.scss-1a27c...f07c.css"):
  </code></pre>
  
  <p>Even though that file exists in public/assets</p>
  
  <pre><code>$ ls public/assets/def*
  public/assets/default.scss-1a27c...f07c.css     public/assets/default.scss.css
  public/assets/default.scss-1a27c...f07c.css.gz  public/assets/default.scss.css.gz
  </code></pre>
  
  <p>What do I need to change to get the server to find the asset file?</p>
  
  <p>Same is happening for my other .css files.  They get compiled into public/assets with finger prints but then are not found.</p>
  
  <p>Page source is showing: </p>
  
  <pre><code>&lt;link href="/assets/default.scss-1a27c...f07c.css" 
  media="screen" rel="stylesheet" type="text/css" /&gt;
  </code></pre>
  
  <p>The rails (haml) source is <code>= stylesheet_link_tag 'default.scss.css'</code></p>
  
  <p><code>public.assets</code> curently includes has the following files.</p>
  
  <pre><code>$ ls public/assets/def*
  public/assets/default.scss-1a27c22229b7b522066181f27af4f07c.css
  public/assets/default.scss-1a27c22229b7b522066181f27af4f07c.css.gz
  public/assets/default.scss.css
  public/assets/default.scss.css.gz
  </code></pre>
  
  <p>application.rb has </p>
  
  <pre><code>$ cat config/application.rb 
  require File.expand_path('../boot', __FILE__)
  
  # Pick the frameworks you want:
  require "active_record/railtie"
  require "action_controller/railtie"
  require "action_mailer/railtie"
  require "active_resource/railtie"
  require "sprockets/railtie"
  # require "rails/test_unit/railtie"
  
  if defined?(Bundler)
    # If you precompile assets before deploying to production, use this line
    Bundler.require(*Rails.groups(:assets =&gt; %w(development test)))
    # If you want your assets lazily compiled in production, use this line
    # Bundler.require(:default, :assets, Rails.env)
  end
  
  module Linker
    class Application &lt; Rails::Application
      config.encoding = "utf-8"
      config.filter_parameters += [:password]
      config.assets.enabled = true
      config.assets.initialize_on_precompile = false # For Heroku
      config.assets.version = '1.0'
    end
  end
  </code></pre>
  
  <p><code>config/environments/production</code> has:</p>
  
  <pre><code>$ cat config/environments/production.rb 
  Linker::Application.configure do
    config.consider_all_requests_local       = false
    config.action_controller.perform_caching = true
    config.assets.precompile += ['default.scss.css','main.css', 'jquery-ui-1.8.22.custom.css']
    config.serve_static_assets = false
    config.assets.compress = true
    config.assets.compile = false
    config.assets.digest = true
    config.log_level = :debug
    config.i18n.fallbacks = true
    config.active_support.deprecation = :notify
  end
  </code></pre>
  
  <p>This seems to be happening for all assets, e.g.</p>
  
  <pre><code>Started GET "/assets/default.scss-1a27c22229b7b522066181f27af4f07c.css" for 127.0.0.1 at 2014-02-23 10:24:47 -0500
  ActionController::RoutingError (No route matches [GET] "/assets/default.scss-1a27c22229b7b522066181f27af4f07c.css"):
  Started GET "/assets/main-6864687b4114a1c316e444bd90f233ff.css" for 127.0.0.1 at 2014-02-23 10:24:47 -0500
  ActionController::RoutingError (No route matches [GET] "/assets/main-6864687b4114a1c316e444bd90f233ff.css"):
  Started GET "/assets/jquery-ui-1.8.22.custom-24319b4b1218846a3fe22a0479ae98b4.css" for 127.0.0.1 at 2014-02-23 10:24:47 -0500
  ActionController::RoutingError (No route matches [GET] "/assets/jquery-ui-1.8.22.custom-24319b4b1218846a3fe22a0479ae98b4.css"):
  Started GET "/assets/application-fc1d492d730f2a45581a40eac4607db8.js" for 127.0.0.1 at 2014-02-23 10:24:47 -0500
  ActionController::RoutingError (No route matches [GET] "/assets/application-fc1d492d730f2a45581a40eac4607db8.js"):
  Started GET "/images/link.ico" for 127.0.0.1 at 2014-02-23 10:24:48 -0500
  ActionController::RoutingError (No route matches [GET] "/images/link.ico"):
  </code></pre>