Heroku 部署资产预编译在 rails 6 上失败
Heroku deplyoment asset precompiling failed on rails 6
我需要帮助。尝试将我的应用程序上传到 heroku 时出现此错误,有人知道为什么吗?
完全错误 link https://pastebin.com/GZCziNpM
remote: 821 | (node::addon_register_func) (regfunc), \
remote: | ^
remote: /app/.node-gyp/16.13.1/include/node/node.h:855:3: note: in expansion of macro ‘NODE_MODULE_X’
remote: 855 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
remote: | ^~~~~~~~~~~~~
remote: ../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
remote: 358 | NODE_MODULE(binding, RegisterModule);
remote: | ^~~~~~~~~~~
remote: make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
remote: make: Leaving directory '/tmp/build_6edbe6b2/node_modules/node-sass/build'
remote: gyp ERR! build error
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack at ChildProcess.onExit (/tmp/build_6edbe6b2/node_modules/node-gyp/lib/build.js:262:23)
remote: gyp ERR! stack at ChildProcess.emit (node:events:390:28)
remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
remote: gyp ERR! System Linux 4.4.0-1097-aws
remote: gyp ERR! command "/tmp/build_6edbe6b2/bin/node" "/tmp/build_6edbe6b2/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
remote: gyp ERR! cwd /tmp/build_6edbe6b2/node_modules/node-sass
remote: gyp ERR! node -v v16.13.1
remote: gyp ERR! node-gyp -v v3.8.0
remote: gyp ERR! not ok
remote: Build failed with error code: 1
remote: D, [2021-12-27T03:59:25.594596 #299] DEBUG -- [Bugsnag]: Not notifying SystemExit due to ignore being signified in internal middlewares
remote: D, [2021-12-27T03:59:25.597384 #299] DEBUG -- [Bugsnag]: Not notifying SystemExit due to ignore being signified in internal middlewares
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: !
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to cards-staging.
remote:
我在 config/application.rb 上添加了这个,但没有区别
config.assets.initialize_on_precompile = false
部署了几次,发现public/assets文件夹有问题,需要部署到本地。有什么解决这个问题的建议吗?
其实我的webpacker已经过时了所以我只需要更新到最新版本就可以了
yarn upgrade @rails/webpacker --latest
我需要帮助。尝试将我的应用程序上传到 heroku 时出现此错误,有人知道为什么吗?
完全错误 link https://pastebin.com/GZCziNpM
remote: 821 | (node::addon_register_func) (regfunc), \
remote: | ^
remote: /app/.node-gyp/16.13.1/include/node/node.h:855:3: note: in expansion of macro ‘NODE_MODULE_X’
remote: 855 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
remote: | ^~~~~~~~~~~~~
remote: ../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
remote: 358 | NODE_MODULE(binding, RegisterModule);
remote: | ^~~~~~~~~~~
remote: make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
remote: make: Leaving directory '/tmp/build_6edbe6b2/node_modules/node-sass/build'
remote: gyp ERR! build error
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack at ChildProcess.onExit (/tmp/build_6edbe6b2/node_modules/node-gyp/lib/build.js:262:23)
remote: gyp ERR! stack at ChildProcess.emit (node:events:390:28)
remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
remote: gyp ERR! System Linux 4.4.0-1097-aws
remote: gyp ERR! command "/tmp/build_6edbe6b2/bin/node" "/tmp/build_6edbe6b2/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
remote: gyp ERR! cwd /tmp/build_6edbe6b2/node_modules/node-sass
remote: gyp ERR! node -v v16.13.1
remote: gyp ERR! node-gyp -v v3.8.0
remote: gyp ERR! not ok
remote: Build failed with error code: 1
remote: D, [2021-12-27T03:59:25.594596 #299] DEBUG -- [Bugsnag]: Not notifying SystemExit due to ignore being signified in internal middlewares
remote: D, [2021-12-27T03:59:25.597384 #299] DEBUG -- [Bugsnag]: Not notifying SystemExit due to ignore being signified in internal middlewares
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: !
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to cards-staging.
remote:
我在 config/application.rb 上添加了这个,但没有区别
config.assets.initialize_on_precompile = false
部署了几次,发现public/assets文件夹有问题,需要部署到本地。有什么解决这个问题的建议吗?
其实我的webpacker已经过时了所以我只需要更新到最新版本就可以了
yarn upgrade @rails/webpacker --latest