I am trying to run rails(dont know much about it) in production mode using the following command:
rails server -e production
But I am getting these errors in console and an ugly page without the css is getting loaded:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://10.20.200.199:3000/".
(index):1 Refused to execute script from 'http://10.20.200.199:3000/javascripts/application.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
(index):1 Refused to execute script from 'http://10.20.200.199:3000/logins/plugins.js?v=1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
This is happening in all the scripts we are using.
Can somebody help me what might be going wrong here.
Thanks in advance.
For running with production environment prebuild assests: rake assets:precompile
The described errors suggest that the browser requests static assets; these aren't built (they aren't built automatically in production - you are expected to build them on each deploy), so nothing is found at their URLs and error page is rendered instead. Thus the browser errors saying that the downloaded css and javascript files have wront MIME types.
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