0

I've tried numerous fixes and variations of those fixes that I've found online but none work. My problem is that I have a custom stylesheet that is called if the browser is IE (stylesheet-ie.css.scss). I've ran the following with no success:

rake assets:precompile

I get the following error in production.log after running compile command.

ActionView::Template::Error (stylesheet-ie.css isn't precompiled):
    14:     <title><%= full_title(yield(:title)) %></title>
    15:     <%= stylesheet_link_tag    "application", media: "all" %>
    16:     <!--[if IE]>
    17:       <%= stylesheet_link_tag("stylesheet-ie") %>
    18:     <![endif]-->
    19:     <%= javascript_include_tag "application" %>
    20:     <%= csrf_meta_tags %>

In production.rb I have:

config.assets.precompile += ['stylesheet-ie.css']

The file is assets/stylesheet/stylesheet-ie.css.scss...I had it as stylesheet.css before but changed it trying to get it to work. Neither way works.

At this point I don't know what else to do.

2 Answers 2

1

Does this work in development environment?

While doing a precompile, you will have to specify the environment. Are you doing this anywhere?

RAILS_ENV=production rake assets:precompile 

This should compile your assets in case you are not mentioning your environment elsewhere.

0
0

Hrm.

I have my config/application.rb set up like this:

config.sass.load_paths << File.expand_path('../../lib/assets/stylesheets/')
config.assets.precompile += %w(jquery.animate-colors-min.js ie.js ie8.css)

So it's pretty similar, but you didn't mention the load_paths. (Also, BTW, I'm using .css.sass, so I'm not sure if you'll need to fiddle with config.sass or config.scss.)

—☈

1
  • I did have the load_paths function but I added after seeing your example. I don't know if I got the path right but I tried the following and I got the same message in the logs files. config.sass.load_paths += ['assets/stylesheets/'] Aug 21, 2012 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.