font_assets icon indicating copy to clipboard operation
font_assets copied to clipboard

Error when recompiling asset

Open ccfiel opened this issue 9 years ago • 4 comments

When rails precompile the assets RAILS_ENV=production bundle exec rake assets:precompile

I got this error No such middleware to insert before: "ActionDispatch::Static"

Any idea how to resolve this?

Rails 4.2.2

ccfiel avatar Jul 30 '15 00:07 ccfiel

+1 rails 4.0.13

fbbergamo avatar Aug 03 '15 20:08 fbbergamo

+1 Seeing the same behavior here on Rails 4.2.1.

jfly avatar Nov 03 '15 08:11 jfly

+1 4.2.4

imgarylai avatar Jan 06 '16 11:01 imgarylai

This gem only works if you are NOT precompiling your assets in production, because it requires asset requests to go through the Rails app, and if you precompile your assets then you are most likely serving them through a web server like NGINX. If this is the case, don't use this gem but instead look into configuring the CORS headers for font requests. For example, here is a way to do that in NGINX.

ericallam avatar Sep 02 '16 14:09 ericallam