Rails 4 Asset Container Loses Provider Assets

I can’t figure out how to make asterisks find assets in vendor/assets . I started off the problem by adding all my assets to app/assets , but it got too cluttered.

I read the documentation and tried to add all 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 click them on the server, none of my provider assets are missing. I use capistrano for deployment, and I know that there were some upgrade issues. This may be the cause of the problem, but I followed the documentation to make it deploy (almost) everything is fine.

+7
ruby-on-rails ruby-on-rails-4 asset-pipeline sprockets capistrano
source share
2 answers

The problem was that I was stupid and quickly jumped from a gun to other problems. I dived too far down the rabbit hole and lost sight of what was happening. I did not specify the type of the otf file in the regular expression, and it did not otf on.

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/ 
+2
source share

When you run rake assets:precompile , do you manually install env for production?

The team should read:

RAILS_ENV=production rake assets:precompile

0
source share

All Articles