Environment: heroku
Rails: 4
Ruby: 2
We deployed an app to heroku, and it seemed as though anything in the public folder was not accessible (didn't see the static file so the router kicked in and then complains about no route matching).
To get around this, we set
# Rails 4 only flag config.serve_static_assets = true
in our production.rb file. Is this really the best way to handle this? Or did we fail to configure the app some how to be hosted on heroku properly?
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
This is deprecated in Rails 4.2, and it is now an alias slated to be removed in Rails 5.0
config.serve_static_assets = true
It should be changed to:
config.serve_static_files = true
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