-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asset-url not working in Rails 4 #169
Comments
I just tested in a fresh Rails application and everything worked fine.
|
I have just tried this in a fresh Rails 4.0.1 app, and it does not work: Here is what is in my global.css.scss file:
When I look at the CSS file that comes out in production, I see:
I've been struggling to link to assets in the SCSS files, as they don't appear to have the digest automatically added to the file name. I've tried a bunch of different scenarios, but the digest URL just doesn't show up in production. I've even tried adding .erb and linking to <%= asset_url('overlay.png') %> but that also shows the non-digest URL in production. Any ideas? For example, on the same page I have the following, and it links to the digest version:
|
Like I commented, I could not reproduce this. Could you provide an example application? |
We are running into this same problem. The issue we are having is we want to precompile our assets before pushing to production, but our production environment will not work from where we are compiling assets from. Running We could create a new environment just for precompiling assets, but it would be better if it could work out of the box. |
I had to specifically set |
I think I'm having a related problem please refer to Bootstrap-sass issue 653 for background. In a nutshell: The asset w/ the digest exists. Just Rails doesn't look for it for some strange reason. In diagnosing this I moved the fonts to assets/fonts and used the |
Rails expects precompilation to happen in production (e.g. on deploy). Digests are controlled by |
I'm also experiencing this problem. Assets are precompiled with a digest appended to the name but |
Had the same problem, fixed it by enabling |
@Eptis you are a legend! Seriously. Come to South Africa and I will buy you a beer! |
Well South Africa is on my schedule for this year so I might take you up on that offer ;) |
Ping me any time :) |
I run into the exact same problem: To solve it:
The |
Hi,
I cannot figure out what I am doing wrong here. I am using asset-url with the font declaration in a .scss file and when I compile to .css, nothing changes. The asset-url isn't being parsed. I am hoping this helper picks up the MD5 fingerprint on a production compile as well, but I haven't gotten that far yet.
@font-face {
font-family: 'FontAwesome';
src: asset-url("fontawesome-webfont.eot", font);
src: asset-url("fontawesome-webfont.eot", font) format('embedded-opentype'),
asset-url("fontawesome-webfont.woff", font) format('woff'),
asset-url("fontawesome-webfont.ttf", font) format('truetype'),
asset-url("fontawesome-webfont.svg", font) format('svg');
// src: url('#{$FontAwesomePath}/FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
Becomes:
@font-face{font-family:'FontAwesome';src:asset-url("fontawesome-webfont.eot", font);src:asset-url("fontawesome-webfont.eot", font)
Thanks.
The text was updated successfully, but these errors were encountered: