我正在尝试使用 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 分钟,然后该进程似乎被杀死了,但它仍然说"编译资产"。
似乎在有多个资产时在远程执行捆绑执行 exec rake assets:precompile 失败了。
解决方案是在本地编译资产,然后将其重新同步到远程服务器。