简体   繁体   中英

Heroku deplyoment asset precompiling failed on rails 6

I need help. When trying to upload my app to heroku, I get this error, anyone know why?

Complete error on this 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: 

I have add this on config/application.rb, but there's no difference

config.assets.initialize_on_precompile = false

I have deploy it several times, and I found that there's a problem on public/assets folder so I need to deploy it locally. Any suggestion to solve this?

actually my webpacker is obsolete so I only need to update it to the latest version, then it works again

yarn upgrade @rails/webpacker --latest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM