I've a really weird problem here. I'm using the rack-zippy
gem in my rails application and if I start it in development
environment without pre-compiled assets it works like a charm. With the -d
param and without.
In production mode (same machine, same project, same directory, same gems) it works too. But if I start it with the -d
param (bundle exec rails server -d
) to daemonize the server, the pre-compiled assets will not be served. Can reproduce that with thin
and webrick
but NOT with unicorn
.
The log says:
ActionController::RoutingError (No route matches [GET]
"/assets/application-b9b75968aed42128cfd75fb78df1e4d1.js"):
but:
$ l public/assets/application-b9b75968aed42128cfd75fb78df1e4d1.js
-rw-r--r-- 1 public/assets/application-b9b75968aed42128cfd75fb78df1e4d1.js
From config/environments/production.rb:
config.serve_static_assets = true
From config/application.rb:
config.middleware.swap(ActionDispatch::Static, Rack::Zippy::AssetServer)
And:
$ rake middleware
use Rack::Sendfile
use Rack::Zippy::AssetServer
(...)
I'm somewhat confused right now. Any ideas?