So I guess my questions is, what is the proper way to include this stylesheet (and font files) so that all works as it should and I don’t have to hack around this.
In my app/assets/css/application.css.scss I have included the following line:
*= require fonts/stylesheet.css
Then when I precompile I get the following:
Compiled fonts/stylesheet.css (0ms) (pid 30638)
This means that the compiled application.css contains the result of compiling fonts/stylesheet.scss
The error you're seeing indicates that you're link directly to fonts/stylesheet.css (ie the produced HTML contains a <link> tag whose href is pointing at that file.
If you want to be able to link to css or javascript like this you need to add the file to the list of items to precompile separately ( there's a setting for this in production.rb). Alternately you could just link to application.css
I my /app/views/layouts/application.html.haml I had folowing:
= stylesheet_link_tag “application”, :media => “all”
= stylesheet_link_tag “style”, :media => “all”
Removing stylesheet_link_tag “style”, :media => “all” has solved the problem.
So in your case probably you have to remove something like: stylesheet_link_tag “fonts”
In my app/assets/css/application.css.scss I have included the following line:
*= require fonts/stylesheet.css
Then when I precompile I get the following:
Compiled fonts/stylesheet.css (0ms) (pid 30638)
This means that the compiled application.css contains the result of compiling fonts/stylesheet.scss
The error you’re seeing indicates that you’re link directly to fonts/stylesheet.css (ie the produced HTML contains a tag whose href is pointing at that file.
If you want to be able to link to css or javascript like this you need to add the file to the list of items to precompile separately ( there’s a setting for this in production.rb). Alternately you could just link to application.css
I my /app/views/layouts/application.html.haml I had folowing:
= stylesheet_link_tag “application”, :media => “all”
= stylesheet_link_tag “style”, :media => “all”
Removing stylesheet_link_tag “style”, :media => “all” has solved the problem.
I just took a look at my application.html.erb file and saw that I had the following:
I my /app/views/layouts/application.html.haml I had folowing:
= stylesheet_link_tag “application”, :media => “all”
= stylesheet_link_tag “style”, :media => “all”
Removing stylesheet_link_tag “style”, :media => “all” has solved the problem.
I just took a look at my application.html.erb file and saw that I had the following: