ruby-on-rails - Heroku deplyoment Assets 预编译在 rails 6 上失败

标签 ruby-on-rails ruby heroku

我需要帮助。尝试将我的应用上传到 heroku 时出现此错误,有人知道为什么吗?

此链接上的完整错误 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

关于ruby-on-rails - Heroku deplyoment Assets 预编译在 rails 6 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70491693/

相关文章:

heroku - heroku 中的信用卡验证

ruby-on-rails - 如何在Rails控制台中通过脚本测试SQLite数据库?

ruby-on-rails - 正则表达式未按预期工作

ruby-on-rails - 在 Ruby on Rails 中搜索一行代码以更改数据库中的属性

ruby-on-rails - 如何使用具有多对多关系的事件记录信誉 gem

python - 当客户端连接不稳定时,在 heroku 上运行的 django 中的工作人员卡在岗位上

sql - 使用 JSONB 数据查询 Postgres 表

ruby-on-rails - Highcharts 超过了 chrome 中的容器

ruby - Grunt/Bundler 不会使用指定的 sass 版本

python - 如何使用 Python 迁移将 Heroku Django 应用程序的新模型表添加到远程 Heroku Postgres?