I am using Passenger and Rails' :cache => true
to cache all my css into one big file. Deploys are done via Capistrano.
Now sometimes(!), the mem-generated all.css
file can't be found after the app is restarted (and I get an error in the log)
ActionController::RoutingError (No route matches "/stylesheets/all.css" with {:method=>:get}):
passenger (2.2.2) lib/phusion_passenger/rack/request_handler.rb:81:in `process_request'
passenger (2.2.2) lib/phusion_passenger/abstract_request_handler.rb:203:in `main_loop'
Placing another restart.txt
file manually or a cap deploy:restart
will resolve the issue.
It's not a big thing, but it's always tedious to check and fix. Anybody has an idea what I am doing wrong?
Edit
My deploy:restart
looks like this (exactly what I am doing manually).
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
Also I am not using any special (external) CSS files in my caching.
<%= stylesheet_link_tag "clear", "application", "contracts", :cache => true %>