RAILS 6 构建失败

RAILS 6 Build Failed

提问人:Jaymarc San Luis 提问时间:11/7/2023 最后编辑:Jaymarc San Luis 更新时间:11/9/2023 访问量:73

问:

修复 babel 问题后在 heroku 中构建后,我遇到了这个问题,我仍然收到此错误。

       Done in 13.56s.
       autoprefixer: /tmp/build_0623a275/app/assets/stylesheets/application.scss:25571:3: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
       autoprefixer: /tmp/build_0623a275/app/assets/stylesheets/chat.scss:25570:3: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
       Compiling...
       Compilation failed:
       Error: error:0308010C:digital envelope routines::unsupported
           at new Hash (node:internal/crypto/hash:68:19)
           at Object.createHash (node:crypto:138:10)
           at CompressionPlugin.taskGenerator (/tmp/build_0623a275/node_modules/compression-webpack-plugin/dist/index.js:163:38)
           at taskGenerator.next (<anonymous>)
           at /tmp/build_0623a275/node_modules/compression-webpack-plugin/dist/index.js:216:49
           at CompressionPlugin.runTasks (/tmp/build_0623a275/node_modules/compression-webpack-plugin/dist/index.js:236:9)
           at /tmp/build_0623a275/node_modules/compression-webpack-plugin/dist/index.js:270:18
           at _next0 (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:37:17)
           at eval (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:53:1)
           at WebpackAssetsManifest.handleEmit (/tmp/build_0623a275/node_modules/webpack-assets-manifest/src/WebpackAssetsManifest.js:486:5)
           at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:49:1)
           at AsyncSeriesHook.lazyCompileHook (/tmp/build_0623a275/node_modules/tapable/lib/Hook.js:154:20)
           at Compiler.emitAssets (/tmp/build_0623a275/node_modules/webpack/lib/Compiler.js:491:19)
           at onCompiled (/tmp/build_0623a275/node_modules/webpack/lib/Compiler.js:278:9)
           at /tmp/build_0623a275/node_modules/webpack/lib/Compiler.js:681:15
           at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
           at AsyncSeriesHook.lazyCompileHook (/tmp/build_0623a275/node_modules/tapable/lib/Hook.js:154:20)
           at /tmp/build_0623a275/node_modules/webpack/lib/Compiler.js:678:31
           at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
           at AsyncSeriesHook.lazyCompileHook (/tmp/build_0623a275/node_modules/tapable/lib/Hook.js:154:20)
           at /tmp/build_0623a275/node_modules/webpack/lib/Compilation.js:1423:35
           at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
           at AsyncSeriesHook.lazyCompileHook (/tmp/build_0623a275/node_modules/tapable/lib/Hook.js:154:20)
           at /tmp/build_0623a275/node_modules/webpack/lib/Compilation.js:1414:32
           at eval (eval at create (/tmp/build_0623a275/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
           at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
       

 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

我正在寻找可能的解决方案,我正在使用 Rails 6.1.3、ruby 3.0.1,并使用 yarn 作为包管理器......

Ruby-on-Rails Heroku Hadoop-yarn

评论


答:

0赞 Ilia 11/9/2023 #1

我只是遇到了这个问题。

转到 heroku 中的应用设置,单击 show config vars 并添加以下内容:

在键中:NODE_OPTIONS

在值中:--openssl-legacy-provider

在此更改后,请尝试再次将您的应用程序推送到 heroku。

为我工作,希望它对你有用!

评论

0赞 Ilia 11/9/2023
请将答案标记为正确,让我们知道这是否适合您