Rails 5.1 capistrano卡在webpacker编译资产

Rails 5.1 capistrano is stuck at webpacker compiling assets

我正在尝试使用 capistrano 部署一个 rails 5.1 应用程序,它似乎卡在了编译资产的过程中:

02:38 deploy:assets:precompile
  01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
  01 yarn install v0.27.5
  01 [1/4] Resolving packages...
  01 [2/4] Fetching packages...
  01 warning fsevents@1.1.1: The platform "linux" is incompatible with this module.
  01 info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
  01 [3/4] Linking dependencies...
  01 [4/4] Building fresh packages...
  01 Done in 48.92s.
  01 Webpacker is installed  
  01 Using /project_name/releases/20170807195158/config/webpack/paths.yml file for setting up webpack paths
  01 Compiling webpacker assets 

没有错误,只是在那里停留了几个小时。如果我检查在远程服务器上执行此操作的节点进程,它说它使用 100% 的 cpu 大约 5 分钟,然后该进程似乎被杀死,但它仍然显示 "Compiling assets".

似乎当有多个资产时在远程执行 bundle exec rake assets:precompile 失败。

解决方案是在本地编译资源,然后将它们 rsync 到远程服务器。