Rails assets missing after Capistrano deploy Rails assets missing after Capistrano deploy nginx nginx

Rails assets missing after Capistrano deploy


Your precompiled assets should reside in public/assets, see rails guides
normally you create them by running

RAILS_ENV=production bundle exec rake assets:precompile

as part of your deployment.
The shared stuff is to provide old stuff over several deploys.

See also this question


The problem might not be in asset compilation and deployment. Try changing nginx root /home/deploy/app_name/public; to /home/deploy/app_name/current/public; in nginx configuration file /etc/nginx/sites-enabled/default.

sudo nano /etc/nginx/sites-enabled/default

following is my configuration file

upstream app {  # Path to Puma SOCK file, as defined previously  server unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock fail_timeout=0;}server {  listen 80;  server_name localhost;  root /home/deploy/app_name/current/public;  try_files $uri/index.html $uri @app;  location / {    proxy_set_header X-Forwarded-Proto $scheme;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_set_header X-Real-IP $remote_addr;    proxy_set_header Host $host;    proxy_redirect off;    proxy_http_version 1.1;    proxy_set_header Connection '';    proxy_pass http://app;  }  location ~ ^/(assets|fonts|system)/|favicon.ico|robots.txt {    gzip_static on;    expires max;    add_header Cache-Control public;  }  error_page 500 502 503 504 /500.html;  client_max_body_size 4G;  keepalive_timeout 10;}

Hope this helps