title: Rails App On Heroku - Status 500 Error => Blank White Page
body: <p>I have a Rails app on Heroku staging server and everything has gone well except for the error pages aren't working. Every time I get a "status: 500" error, it results in a blank white page, NOT the 500.html static error page. </p>
  
  <p>I have a static 500.html page in the my_app/public folder, and I can access it in heroku if I try to do so directly via myapp.herokuapp.com/500. It will display fine then. But if I get a real "status: 500" error in the program, it will not render the 500.html page... rather, it renders a blank white page. </p>
  
  <p>To create an error, I attempted to go to a non-existent page.
  The logs indicate that the "status: 500" error has occured, but again, white page. Here is part of the output from the logs:</p>
  
  <pre><code>heroku[router]: at=info method=GET path="/fakepage" host=myapp.herokuapp.com request_id=20825-b474-4e-37f-c52486140 fwd="67.xxx.xxx.x" dyno=web.1 connect=1ms service=108ms status=500 bytes=949
  Started GET "/fakepage" for xx.xxx.xxx.x at 2014-08-24 03:50:31 +0000
  app[web.1]: ** [Raven] User excluded error: #&lt;ActionController::RoutingError: No route matches [GET] "/fakepage"&gt;
  </code></pre>
  
  <p>In the <strong>config/environment/staging.rb</strong> I have the following:</p>
  
  <pre><code>config.consider_all_requests_local = false
  config.serve_static_assets = true  #after the default of false didn't work
  </code></pre>
  
  <p>It seems like this shouldn't be one of those "tough issues"... and not finding any prior posts or articles that directly related to my question makes me think it must be something inane on my part. I'm currently running Ruby 2.0.0p451 &amp; Rails 4.1.1. I have Sentry setup through heroku for monitoring errors. Let me know if there's any other useful info I could provide. </p>
  
  <p><strong>EDIT</strong>
  I should mention that my Gemfile looks like this:</p>
  
  <pre><code>  source 'https://rubygems.org'
    ruby '2.0.0'
    gem 'rails' #, '4.1.1'
  
    gem 'bcrypt'
    gem 'bootstrap_form'
    gem 'bootstrap-sass'
    gem 'carrierwave'                 
    gem 'coffee-rails'
    gem 'dropzonejs-rails'
    gem 'email_validator'             
    gem 'fog'                         
    gem 'geocoder'
    gem 'haml-rails'
    gem 'jquery-rails'
    gem 'jquery-turbolinks'
    gem 'jquery-ui-rails'
    gem 'mini_magick'                 
    gem 'paratrooper'                
    gem 'sass-rails'
    gem 'sidekiq'                     
    gem 'sinatra', require: nil       
    gem 'turbolinks'
    gem 'uglifier'
    gem 'unicorn'
  
    group :production, :staging do
      gem 'pg'
      gem 'rails_12factor'
      gem 'sentry-raven'
    end
  </code></pre>
  
  <p>That is, I do have the gem 'rails_12factor' in the correct group for both staging &amp; production environments as noted in <a href="https://stackoverflow.com/questions/17550747/rails-4-enabled-rails-to-serve-static-assets-is-it-correct-on-heroku">a similar question</a> regarding serving static assets in heroku with Rails4... essentially what an error page would be doing.
  I have the app setup to run multiple processes through Unicorn, and have Unicorn temporarily setup to handle Sidekiq processes internally while the app is in testing (to avoid a second dyno). Also running Redis.</p>
  
  <p><strong>config/environments/staging.rb</strong></p>
  
  <pre><code>Rails.application.configure do
    config.cache_classes = true
    config.eager_load    = true
    config.consider_all_requests_local       = false
    config.action_controller.perform_caching = true
  
    config.serve_static_assets  = true
    config.assets.js_compressor = :uglifier
    config.assets.compress = true
    config.assets.compile  = true #WAS FALSE
    config.assets.digest   = true
    config.assets.version  = '1.0'
  
    config.action_mailer.default_url_options = { host: "..." }
    config.action_mailer.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
      :port           =&gt; ENV['MAILGUN_SMTP_PORT'    ],
      :address        =&gt; ENV['MAILGUN_SMTP_SERVER'  ],
      :user_name      =&gt; ENV['MAILGUN_SMTP_LOGIN'   ],
      :password       =&gt; ENV['MAILGUN_SMTP_PASSWORD'],
      :domain         =&gt; '...',
      :authentication =&gt; :plain }
  
    config.log_level = :info #see everything in the log
    config.i18n.fallbacks = true
    config.log_formatter = ::Logger::Formatter.new
    config.action_dispatch.show_exceptions = false #per sentry-raven docs
    config.active_record.dump_schema_after_migration = false
    config.active_support.deprecation = :notify #send to registered listeners
  </code></pre>