-
Notifications
You must be signed in to change notification settings - Fork 621
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
No such middleware to insert before: ActionDispatch::Static (RuntimeError) on production #1101
Comments
I had the same problem. Just change:
into:
If it wont work show me content of the |
Yeah, that was the same conclusion I drew. I think there should be a note somewhere in the documentation on this point. |
Well, the Engine v3 is still beta version. I think it could be great to add info about executing I'm not sure if it generates correct |
Hey @did, In current RAILS, config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? The middleware 65 initializer 'locomotive.middlewares' do |app|
66 require 'locomotive/middlewares'
67
68-> app.middleware.insert_before ActionDispatch::Static, '::Locomotive::Middlewares::ImageThumbnail'
69 app.middleware.use '::Locomotive::Middlewares::Site'
70 end Hope this helps. |
@aeberlin I see, it makes totally sense now. |
thanks guys |
^_^ |
Also, @adam-pl, serve_static_assets should be an alias for serve_static_files, until RAILS 5.0. Not sure why that helped you. Anyway, cheers. |
@aeberlin, I'm using Anyway I prefere using
I do not like any warning that occurs while deployment is in progress (got it with using the Capistrano & ruby 2.2.1). |
Ah, I see. You said false in both lines in your previous comment, now I see that was a typo. Cheers |
Yeah :) Cheers |
FYI there is one approach |
In production, with
config.serve_static_assets = false
:It seems, based on the documentation here, that
ActionDispatch::Static
is only inserted whenserve_static_assets
is true.Is this expected behavior from locomotive's perspective, that this should be enabled even in production? If so, how does one handle assets being served from alternative nodes? Either way, probably should be mentioned in documentation somewhere, since it took me a bit to track down and I'm rather proficient.
The text was updated successfully, but these errors were encountered: