-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling assets manifest files with a multi-server setup #28
Comments
Ah yes, this caused me a little bit of headache too. I'm using asset_sync to upload my assets to S3 (from which they are served). Therefore, my non-release
In order to do this, I also needed to add the following:
This is because the asset_sync gem has to use the Rails environment to compile the assets, and in order to do this, it has to connect to the db. In conclusion: I'm not happy with the amount of extra config I have to do in my |
Ok, thanks for confirming this wasn't working out of the box for you too. |
My setup is not ideal either. It would be nicer if I could have the compilation take place on 1 node (primary app, web, or whatever) and then to copy the manifest file to the app nodes. To be honest, I'm not entirely clear how assets work if they aren't served from a different role than app. Does the app role need the actual assets or is the manifest sufficient? |
Thanks for stepping out about your uncertainness on the topic because I feel fuzzy about all this too. I'm afraid I don't understand this more than how it's described in the first post. I've opened an issue on capistrano-rails so let's say what those people say. |
By default this gem isn't compiling assets on the web nodes for me. Any ideas why this would be happening? Same scenario as you both talked about above (albeit late last year) |
I had to remove the |
On a multi-server setup with separate
web
andapp
nodes, assets do not seem to work. The page is served without css and javascript.I'm working with a minimal scaffolded rails 4 app. Here is how the generated links to css and js files look like:
I investigated this and the reason for this seems to be: assets aren't pre-compilated on the
app
servers so there's no asset manifest file on those nodes and they generate wrong css & js references.Fixing this is relatively simple:
capistrano-rails
pre-compiles assets on theweb
node by default. Manifest file is also present there.web
node toapp
nodes manually and restartingunicorn
processes did the trick. See below how the generated css & js references now look like.web
role, directly from the disk which seems right@rhomeister how did you handle this in your setup?
I wonder why noone handled this in capistrano-rails? Not even an issue was opened related to this so I'm worried I'm missing something.
The text was updated successfully, but these errors were encountered: