Closed rmosolgo closed 9 years ago
Thank you for an excellent issue report.
Are you precompiling your assets in production? Your view doesn't seem to pick up on this fact. Maybe you haven't run the precompilation on the machine that handles your background jobs?
Your asset URL also seem to be non-standard. The filesystem provider automatically tries to remove /assets
before looking, but I only see /stylesheet
here, so either it's stripping "assets" and reports the result, or you don't keep your assets under a directory called "assets".
You could try to manually add a new filesystem provider with a prefix that matches your case (See documentation for the method signatures). Does that work like it should?
Thanks for your response.
Maybe you haven't run the precompilation on the machine that handles your background jobs?
This might be true (investigation below), I'm checking now how our other apps handle this situation.
This file should be precompiled:
config.assets.precompile += [
"email.css",
# ...
]
And it seems like it is precompoiled. We have a mail preview on Production that uses the correct URL:
However, in a Rails console, the stylesheet_link_tag
comes out "wrong":
include ActionView::Helpers::AssetTagHelper
stylesheet_link_tag("email")
# => "<link rel=\"stylesheet\" media=\"screen\" href=\"/stylesheets/email.css\" />"
It's gotta be something to do with the environment ... hummm... !
Also, it's clear that the file is really there:
$ ls public/assets | grep email
email-d50d5813662811a4dc75aadc1fdc11e6.css
email-d50d5813662811a4dc75aadc1fdc11e6.css.gz
Just make the stylesheet_link_tag
by hand:
doctype html
html
head
link rel='stylesheet' type='text/css' href='/assets/email.css'
I saw that our other apps do this (for some other CSS inlining gem) and it was a workaround on this issue
I wish I could have found the "real" issue, sure seems like something about my environment ... but I have to get this show on the road!
Thanks again for your help and for your work on this project!
Thanks for all your great work on this project! It's worked like a charm for the last 8 months, just hitting some issue since upgrading to Rails 4.2.
I see some issues about Rails 4.2 + "CssNotFound" regarding asset hashes, but I think I have a different problem.
Setup
I'm using:
roadie_options
.I have a stylesheet in
/app/assets/stylesheets/email.css.sass
.I have in
/app/views/layouts/email.html.slim
:For mailers, I have ApplicationMailer:
then the concrete mailer:
But I'm getting this error:
In the console
If I open a production console, I can confirm that the stylesheet isn't found:
Raw Stack Trace
??
Do you have any suggestions on how I can find out more info? I'm not sure where to look next!
Thanks for you help!