Here is my (censored) config/deploy.rb:
https://gist.github.com/eedf6c976f632c1242cf
For some reason, any changes to my assets, whether CoffeeScript or SASS/SCSS files, do not appear in production when I first deploy. When I deploy a second time, the assets changes go live. It’s quite a waste of time, and I have no idea why it’s happening. Any ideas?
Okay, I figured out how to get it working, but it isn’t clean. For some reason,
deploy:assets:precompileis being run just beforedeploy:create_symlink, rather than after. The result is that thecurrentdirectory on the server is not yet pointing at the new code when assets are being compiled, so they’re only compiling for the previous deploy. This is why my assets were not updating unless I deployed twice.I applied a quick-fix by adding this:
before "deploy:assets:precompile", "deploy:create_symlink"This triggers the creating the symlink just before precompiling so that asset changes are picked up. The result is that the symlink is created twice, because the existing behavior is also still run. It works, but it feels dirty.
I’m really not sure why this is an issue in the first place, and I don’t understand why nobody else seems to be having this issue; my
deploy.rbis pretty cut-and-dry, nothing too fancy going on. The only thing I can think of is thatload "deploy/assets"isn’t in the right place in the file. I just assumed it went at the top, and I don’t know if it affects the order of execution.Any suggestions as the the correct way to fix this would be greatly appreciated!