I have strange error that appears only in CI environment. This error does not appear in develpment, production or even local test environments.
ActionController::RoutingError: No route matches [GET] "/fonts/bootstrap/glyphicons-halflings-regular.svg"
Full trace can be found here
In development and production enviroments successfull reqest goes to /assets/bootstrap/glyphicons-halflings-regular.woff
. There is a difference in /fonts/
- /assets
and svg
- woff
part. All errors generated by JavaScript enabled tests (Poltergeist / PhantomJS driver). Regular Capybara tests are all green. Chrome devtools says that request for font file is generated by jquery.js, not the page or css file.
This is related to the bootstrap-sass
gem. I'm using version 3.3.4.1 of it with Rails 4.2.
My presenting issue was very similar but slightly different: the same error in CI with 404 for /fonts/bootstrap/glyphicons-halflings-regular.woff
but a different path in dev, /fonts/glyphicons...
.
The solution that worked for me was adding the following line before including the bootstrap JS with SASS:
$icon-font-path: "bootstrap/";
@import 'bootstrap';
My best clue came from the comments on this issue in the gem's tracker: https://github.com/twbs/bootstrap-sass/issues/480#issuecomment-49237119
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With