I'm deploying a rails 4.1.0.rc1 app to production and everything appears to be working except that no assets are being served.
I am deploying to Ubuntu 12.04 on Nginx with Unicorn. Webrick is able to serve the assets with:
config.serve_static_assets = true
in production.rb.
Interestingly, under nginx/unicorn, the assets are being referenced without the fingerprint. I.e /assets/application.css instead of /assets/application-2c83bb5c879fd170625884df41e4b778.css
Of course, when nginx goes to serve the asset, it doesn't exist. This is only an issue with the unicorn/nginx setup, under webrick as production (locally and on the server) the correct filename is present and the asset is correctly served up.
Other than the OS specific parts, I have been following https://www.digitalocean.com/community/articles/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5 .
config/unicorn.rb
# Set the working application directory
# working_directory "/path/to/your/app"
working_directory "/var/www/citysquares"
# Unicorn PID file location
# pid "/path/to/pids/unicorn.pid"
pid "/var/www/citysquares/pids/unicorn.pid"
# Path to logs
# stderr_path "/path/to/log/unicorn.log"
# stdout_path "/path/to/log/unicorn.log"
stderr_path "/var/www/citysquares/log/unicorn.log"
stdout_path "/var/www/citysquares/log/unicorn.log"
# Unicorn socket
listen "/tmp/unicorn.[app name].sock"
listen "/tmp/unicorn.citysquares.sock"
# Number of processes
# worker_processes 4
worker_processes 2
# Time-out
timeout 30
/etc/nginx/conf.d/default.conf
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/tmp/unicorn.citysquares.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
# Application root, as defined previously
#root /root/citysquares/public;
root /var/www/citysquares/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
Any and all help appreciated, this has me stumped!