Topic: Production mode - unable to see css or js

Hi,
I am using rails 3 and when I switch to production mode
Firefox cannot see the css files nor the javascripts.
Crhome can see some of the css and some of the JS.

Development mode works ok.

Please help sad. I am going bananas trying to figure this out.

Thanks.
-Luis.

Re: Production mode - unable to see css or js

When you view the source/HTML for the page rendered does it show it in the <head>. For instance

<script type="text/javascript" src="application.js?84749759477" ></script>

Also, when you are running in production mode is it on a web server or on your local machine?

Last edited by lscott3 (2011-05-10 10:41:43)

Re: Production mode - unable to see css or js

The source shows all of the calls for the scripts.
Production mode is in the local macine.
OSX environment.

Re: Production mode - unable to see css or js

This was taken from stack overflow:

Rails defaults to not serving static assets in production, as the web server is generally more optimized for those kind of tasks. Most likely this is the problem.

To fix it, you can either set

config.serve_static_assets = true

in config/environments/production.rb, or configure the web server to do it for you.

Here is the link:

http://stackoverflow.com/questions/4685 … -in-rails3

Re: Production mode - unable to see css or js

Thanks!
This is the fix.

Re: Production mode - unable to see css or js

Glad it worked!

Re: Production mode - unable to see css or js

Worked!