I can't seem to figure out how to make sprockets find assets in vendor/assets
. I've ben been pushing off the problem by adding all of my assets to app/assets
, but it's becoming way too cluttered.
I have read the documentation, and tried adding all of the following lines to my application.rb
file.
config.assets.paths << "#{Rails.root}/vendor/assets/*"
config.assets.paths << "#{Rails.root}/vendor/assets/fonts"
config.assets.paths << "#{Rails.root}/vendor/assets/stylesheets"
config.assets.precompile << Proc.new { |path|
if path =~ /\.(eot|svg|ttf|woff)\z/
true
end
They work locally, but when I push them to the server, none of my vendor assets are there. I'm using capistrano for deployments, and I know that there were some issues with the upgrade. That could be the root of the problem, but I followed the documentation to get it deploying (almost) everything alright.
The problem turned out to be me being stupid, and quick to jump the gun on other problems. I dove too far down the rabbit hole, and lost sight of what was happening. I did not include the otf
filetype in the regex, and it wasn't being included.
Facepalm
EDIT:
To clarify: all I had to do was change
if path =~ /\.(eot|svg|ttf|woff)\z/
to
if path =~ /\.(eot|svg|ttf|woff|otf)\z/
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