nginx - Rails assets missing after Capistrano deploy -


i'm building vps, , it's deployed via capistrano, database connected etc, there no assets available page - basic html only.

the assets appear compiled, , exist in shared directory.

from page html:

<link href="/assets/application-a1b5d69aeaff709fd3dce163c559b38b.css" media="all" rel="stylesheet" type="text/css" /> <script src="/assets/application-0ebd07089629f8c6880dddfb688d525d.js" type="text/javascript"></script> 

the asset files appear exist in shared directory:

assay@assaypipeline:~/apps/assay/shared/assets$ ls application-  a1b5d69aeaff709fd3dce163c559b38b.css application-a1b5d69aeaff709fd3dce163c559b38b.css 

when view, source , click on hyperlink asset path, 404 not found nginx.

solution

thanks martin m (accepted answer) help. steps took, ~/apps/(app name)/current directory on server.

$ bundle install $ rails_env=production bundle exec rake assets:precompile $ sudo service nginx restart 

obviously better include in capistrano recipe.

*edit - capfile *

load 'deploy' load 'deploy/assets' load 'config/deploy' 

your precompiled assets should reside in public/assets, see rails guides
create them running

rails_env=production bundle exec rake assets:precompile 

as part of deployment.
shared stuff provide old stuff on several deploys.

see question


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -