Skip to content
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

Error when recompiling asset #41

Open
ccfiel opened this issue Jul 30, 2015 · 4 comments
Open

Error when recompiling asset #41

ccfiel opened this issue Jul 30, 2015 · 4 comments

Comments

@ccfiel
Copy link

ccfiel commented Jul 30, 2015

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

@fbbergamo
Copy link

+1 rails 4.0.13

@jfly
Copy link

jfly commented Nov 3, 2015

+1 Seeing the same behavior here on Rails 4.2.1.

@imgarylai
Copy link

+1 4.2.4

@ericallam
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants