anjlab / bootstrap-rails

Twitter Bootstrap CSS (with Sass flavour) and JS toolkits for Rails 3 projects
https://github.com/anjlab/bootstrap-rails
729 stars 96 forks source link

Glyphicon woff files not loading #74

Closed joergd closed 10 years ago

joergd commented 11 years ago

I get a 404 error in my browser dev tools when I try to use glyphicons. It can't find the woff files in /fonts/twitter ...

I am in development. Is there anything I need to do?

krsyoung commented 11 years ago

I'm wrestling with the same issue. Right now I have worked around this specific issue by modifying the following variable in _variables.scss:

//$icon-font-path:          "twitter/" !default;
$icon-font-path:          "/" !default;

However I now have another issue where I just get the error codes (square boxes) vs the proper icons.

I'm running with Rails 4 for reference.

krsyoung commented 11 years ago

One more update ... winner for me was to update the following in _variables.scss:

$icon-font-path:          "/assets/twitter/" !default;

It seems like we should be able to do this via a variable override locally however I can't get it to work (tried to include in application.css.scss to no avail).

krsyoung commented 10 years ago

Still hacking through this one. I did end up getting the override to work in my application.css.scss with something like the following:

// application.css.scss
....
// Override the default icon path
$icon-font-path: "/assets/twitter/";

@import "twitter/bootstrap";

Works like a charm in development however now deploying to production I'm getting hit again without being able to find the woff files.

ActionController::RoutingError (No route matches [GET] "/assets/twitter/glyphicons-halflings-regular.ttf")

Wondering if it is because the unique strings are missing from the url? Actual files are under assets/twitter:

glyphicons-halflings-regular-24dfb40c91db789b8b8faba6886ac1ef.svg
glyphicons-halflings-regular-4b2130768da98222338d1519f9179528.ttf
glyphicons-halflings-regular-7a07f26f72466361ac9671de2d33fd1c.woff
glyphicons-halflings-regular-ab2f6984951c07fd89e6afdefabd93c7.eot
maltefiala commented 10 years ago

This error occurs when you were running rake assets:precompile once in development mode. To fix it, delete all files in public/assets and run RAILS_ENV=production rake assets:precompile

kristinpeterson commented 10 years ago

I'm experiencing this same issue, 404 error on load of glyphicons .woff file in production only. Works great in development with zero tweaking.

I've tried the following, to no avail:

// adding this:
$icon-font-path:          "/assets/twitter/" !default;

// before this:
@import "twitter/bootstrap";

// at the top of application.css.scss

and also as @maltefiala suggested, I deleted the contents of public/assets before pushing to production then ran RAILS_ENV=production rake assets:precompile in production.

Still getting 404 error on load of glyphicons in production after these tweaks. Any help would be much appreciated!

asanger commented 10 years ago

Bumping this - I'm experiencing the same issue. Has anybody found a decent resolution? https://github.com/anjlab/bootstrap-rails/issues/74#issuecomment-29169323 didn't seem to help when I am deploying.

yury commented 10 years ago

@asanger, sorry. But this gem in no longer supported. You should use official bootstrap sass gem.