-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Rails 5.1.7: The asset "../fonts/bootstrap/glyphicons-halflings-regular.eot" is not present in the asset pipeline #1207
Comments
I concur but I think this is not a problem in a specific Rails version, rather a version of sprockets. I took this up on the sprockets-rails repo and they decided that this is a bootstrap-sass issue for not using the sprockets-4.0.0 api correctly. Sprockets has since version 4 stopped supporting regular expressions in asset paths. This was my bug report to sprockets-rails and for that I've set up a reproduction case example app: I've tried my best to try and make a PR, but all the ways I could fathom to try have failed me, relative paths, absolute paths, adding directory to Right now I'm adding absolute file paths to
My engine.rb looks like this: module Bootstrap
module Rails
class Engine < ::Rails::Engine
...
sprockets_version = Sprockets::Rails::VERSION.split('.', 2)[0].to_i
unless sprockets_version == 3
...
end
unless sprockets_version == 4
# sprockets-rails 4 no longer support regexes for asset paths
fileendings = %w(svg ttf woff woff2)
fileendings.each do |fileending|
path = root.join("assets/fonts/glyphicons-halflings-regular.#{fileending}").to_s
uri = "file://#{path}"
app.config.assets.precompile << [uri]
end
end
end
end
end
end |
Did you find a solution to this? We're running into the same issue on rails 5.2 w/sprockets 4. |
I've had no problem running rails 5.2 and sprockets 4 for a while, and think this should be closed. FYI I got here because I thought there was a sprockets 4 problem with rails 6.0 somehow (on upgrade) and investigated rails/sprockets-rails#457 but I think that the response (rails/sprockets-rails#457 (comment)) was a misreading of the code (reading the sprockets < 3 targeted code as if it applied to sprockets 4). When I debugged my situation (an error on CI) I found it was because I was issuing the precompile with different flags from issuing the test code -- ie. one was effectively using RAILS_ENV=development, resulting in (in my configuration) A similar situation would happen if you (somehow) precompile without digests and then run your server with them (but with |
As @StefanWallin linked, problem with sprockets 4, changed path handling, therefore need to help this old gem to find his fonts.
Using this option Content of "bootstrap-custom.scss":
or just:
|
@Faq @StefanWallin I'm unconvinced that sprockets 4 + bootstrap-sass is the root problem here. I just fixed the minimal reproduction repo's issue (thanks for creating this @StefanWallin !) by adding in Here's a screenshot (but do see what happens locally if you want to -- Haven't written a test for this because life is too short 😁 ): I just think it's worth documenting what we know can work, because then we can look for the problems elsewhere. |
Hi there,
I'm running into an issue with
bootstrap-sass
:It seems that the URL is not Rails 5.1.7 friendly.
I think that a search and replace change in the paths might be necessary.
Thanks,
Ernesto
The text was updated successfully, but these errors were encountered: