My app works fine when run in development environment. In production (rails server -e production), the browser can\'t access the css and js files and on the con
I think to Rails 4.x you have to precompile assets to production or use config.assets.compile even both if needed.
The default Rails behavior for production environment is to "Do not fallback to assets pipeline if a precompiled asset is missed." So, don't. Use to not compi
config.assets.compile = false
If you use this option you don't need to use:
config.serve_static_files = true
Because if the asset wasn't precompiled, Rails will compile before serve request.
But if you do precompile the assets before production you don't needs config.assets.compile = true, but you need config.serve_static_files = true to Rails serve requests if you don't have http_server to serve the precompiled assets.
The setting config.serve_static_assets is deprecated.
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly.
I hope this answer help you(reader) to understand whats really happens