In the process of debugging this problem, I have tried to run my application in production mode locally and it doesn't serve up any assets. Additionally, I have a staging environment in a Heroku application (separate from my production Heroku application) which is also now displaying the HTML without any assets.
To debug, I:
rake assets:precompile
rails s -e production
Reload the page to get source for: http://localhost:3000/assets/application-e1f3e0c864a153c7iu66f8772a886376.css
Production.rb:
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
config.assets.compress = false
config.assets.compile = false
config.assets.digest = true
Staging.rb:
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
config.assets.compress = false
config.assets.compile = false
config.assets.digest = true
Application.rb:
config.assets.enabled = true
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
Below is how I link the stylesheet and javascript in layout/application.html.erb:
<%= stylesheet_link_tag "application", :media => "screen, handheld" %>
<%= javascript_include_tag "application" %>
So the problem was that the memory store was set to config.cache_store = :dalli_store
which was causing errors and setting it to config.cache_store = :memory_store
resolved it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With