Skip to content


Subversion checkout URL

You can clone with
Download ZIP


rake assets:precompile error in Rails (FontAwesome) #292

akalyaev opened this Issue · 12 comments

4 participants



I've just updated your gem and run rake assets:precompile and this is what I've got during deploy:

Invalid CSS after "...e.eot);src:url(": expected expression (e.g. fr, 2n+1), was "/assets/"/asset..."

I think, the case is in vendor/toolkit/fontawesome.less:

@font-face {
  font-family: 'FontAwesome';
  src: asset-url(@fontAwesomeEotPath);
  src: asset-url("@{fontAwesomeEotPath}?#iefix") format('embedded-opentype'),
    asset-url(@fontAwesomeWoffPath) format('woff'),
    asset-url(@fontAwesomeTtfPath) format('truetype'),
    asset-url('@{fontAwesomeSvgPath}#FontAwesome') format('svg');

The result of the code above is:

@font-face {
   font-family: 'FontAwesome';
   src: url(/assets/fontawesome-webfont.eot);
   src: url(/assets/"/assets/fontawesome-webfont.eot"?#iefix) format('embedded-opentype'), url(/assets/fontawesome-      webfont.woff) format('woff'), url(/assets/fontawesome-webfont.ttf) format('truetype'), url(/assets/"/assets/fontawesome-webfont.svg"#FontAwesome) format('svg');

rails: 3.2.3
twitter-bootstrap-rails: 2.1.0


same here, but i think this is related to #290


I've just commented out these lines and worked, but now, I'm without fontawesome

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
//@fontAwesomeEotPath: asset-path('fontawesome-webfont.eot');
//@fontAwesomeWoffPath: asset-path('fontawesome-webfont.woff');
//@fontAwesomeTtfPath: asset-path('fontawesome-webfont.ttf');
//@fontAwesomeSvgzPath: asset-path('fontawesome-webfont.svgz');
//@fontAwesomeSvgPath: asset-path('fontawesome-webfont.svg');

// Font Awesome
//@import "fontawesome";

That works, although you can still use the webfont. Remove the svgz version and use absolute paths instead of the asset-path helper. See issue #290 for a more thorough response.


can you provide some example?...i didn't got it :\


No problem:

Copy from the new bootstrap_and_overrides.css.less to resolve the issue. Specifically, you need to remove the svgz font path variable and use absolute paths instead of the asset-path helper (see below):

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not 
// have the proper paths. So for now we use the absolute path.
@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';

thank you :D


@luizkowalski, my pleasure. Cheers!


Thanks @jgrevich. I think this could be closed now.

@akalyaev akalyaev closed this

@akalyaev anytime. I believe we can also close issue #290 as it is a duplicate of this issue.


@akalyaev Was this actually fixed or do we just have a work-around? If it is still an issue I may have time to work on a patch.


@bradly The error was due to people's bootstrap_and_overrides.css.less file declaring variables for the svgz version of the font that no longer exists. The generator has been updated to remove the code, but perhaps we need to improve the error message or provide better documentation for people who are upgrading.


@jgrevich That makes sense. Thanks for the clarification. I just re-ran the rails g bootstrap:install, re-added my changes, and things are working again. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.