Capistrano 3 assets:precompile takes hours. Stops at css file

前端 未结 2 1381
一生所求
一生所求 2021-01-18 05:38

Just as it says, I can\'t get capistrano 3 to do assets:precompile correctly. Even after hours, it still says writing to the .css file on the serv

2条回答
  •  渐次进展
    2021-01-18 05:51

    I had a similar issue where Capistrano 3 freezes on assets:precompile.

    For me it turned out that it was an SSH problem due to the prolonged time it takes to precompile assets on production! Especially if the server memory and CPU specs are not too high.

    Although my connection to the production server was pretty fast and reliable, it seemed that my SSH client just gave up reading output from SSHD server after a certain amount of time.

    The Fix

    Add the following in /etc/ssh/sshd_config on production server to keep connection with SSH client alive:

    ClientAliveInterval 30
    ClientAliveCountMax 10
    

    This fixed the issue and now Capistrano 3 completes deployment with no problems.

提交回复
热议问题