CSS is not loading in app CSS is not loading in app ruby-on-rails ruby-on-rails

CSS is not loading in app


Do you have this in your ProductsController, or if absent, ApplicationController?

layout "application"

You've got a pre-asset pipeline <%= stylesheet_link_tag :all %> somewhere, which normally includes all stylesheets in /public/stylesheets, but it's telling asset pipeline to look for a file named all.css.

Since <%= stylesheet_link_tag :all %> is clearly not in your application.html.erb layout, some other layout is being rendered. Hunt it down, and/or ensure your controller(s) are calling the correct layout.


Run rake assets:precompile to compile and copy your css from /assets to /public (rails 3.1+)


I my case fixing an error in my style sheet and running:

$ RAILS_ENV=development rake assets:clean

has fixed the problem.

Running above command deletes your generated CSS files and forces rails to regenerate the CSS output from your Sass or SCSS files.