Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4 asset pipeline losing vendor assets

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.

like image 627
Peter Klipfel Avatar asked Oct 06 '13 06:10

Peter Klipfel


1 Answers

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/
like image 75
Peter Klipfel Avatar answered Sep 30 '22 19:09

Peter Klipfel