we have the following server setup:
- Application Server
- Background Job Server (ActiveJob with Sidekiq)
- Database Server
The normal workflow would be:
- User visits site and fills out register form
- After submit a welcome email gets set to
deliver_later - Sidekiq does the delivering.
Now we use premailer-rails for styling our emails. The css file is located under app/assets/stylesheets/emails/base.scss. We reference it in the mail.html.haml-Layout with stylesheet_link_tag 'emails/base'. This works great in development and when previewing the mails.
But if we deploy everything and test it out on production we're getting the error:
ActionView::Template::Error: The asset "emails/base.css" is not present in the asset pipeline
It works very well when we're telling capistrano to precompile the assets also on the worker server. But this seems to be a little overhead.
Is this the only solution to fix the problem?
Does anyone have a similar setup and problem?
Regards,
spa
By default, Rails assumes that you have your files pre-compiled in the production environment if you want to use live compiling (compile your assets during runtime) in production you must set the
config.assets.compiletotrue.config/environments/production.rb ...