Closed nosolopau closed 10 years ago
Same here. They do get precompiled, but they are not correctly referenced with digest (as seen above in your picture)
I fixed it by compiling the assets specifically for production mode
RAILS_ENV=production rake assets:precompile
This fixed the issue for me.
Overriding the font's location by adding the following to application.css worked for me
/* Override Bootstrap 3 font locations */
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../assets/glyphicons-halflings-regular.eot');
src: url('../assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../assets/glyphicons-halflings-regular.woff') format('woff'),
url('../assets/glyphicons-halflings-regular.ttf') format('truetype'),
url('../assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
The tip was written in http://www.erikminkel.com/2013/09/01/twitter-bootstrap-3-in-a-rails-4-application/ 's comment section.
I guess the value of asset_path
is wrong...?
We comment out glyphicons and use fontawesome as the default. It is included around L#17 commented out.
If you are using Bootstrap 2.1:
// Glyphicons
//@import "twitter/bootstrap/sprites.less";
If you are using Bootstrap 3.0+:
// Glyphicons
//@import "twitter/bootstrap/glyphicons.less";
And what about if less is not being used?
We don't support SASS.
No, I'm trying to use the static mode.
@take's paths should work then, the static option just means you're using a standard CSS @import statement with the correct path set.
Mmm, yeah, it is true, but for some reason paths are being recognized in the app but not in integration tests...
https://github.com/seyhunak/twitter-bootstrap-rails/pull/802 would fix it as well, you're welcome to try that branch. I got rid of the static option all together because it caused the gem to be cluttered with paths to bootstrap.
Oh, ok, I didn't know the static branch was someway being deprecated. Many thanks for your help :)
Thee static branch became an install option in 2.7, but we then started getting PR's where there was a new version of Bootstrap/Fontawesome for the LESS install but not the static versions or vice-versa. It's better we just manage it with bower internally because it takes the human error out of the equation. Give that branch a try, it's a major change, needs some good testing in the wild.
Hi :)
I'm trying to use glyphicons in my app, using the
bootstrap3
branch and Rails 4.1. I've edited mybootstrap_and_overrides.css
(I'm using the gem with 'plain css', no with less) to set:=require twitter-bootstrap-static/sprites
.And when I load the views, I can see some 404 errors:
I see that the URL for the assets is something like
http://localhost:3000/assets/fonts/glyphicons-halflings-regular.svg
. (note theassets/fonts
part). If I point the browser tohttp://localhost:3000/assets/glyphicons-halflings-regular.svg
then I can download the file.I've reviewed all the issues mentioning similar problems, but I can't find a solution. Any suggestion or idea will be very appreciated :).