railsアプリからherokuへのdeployでエラーが発生し、解決できません。  
自分でしたことは、rubyとherokuのversionが不一致とのことで  
下のようにしました。  
ruby 2.7.0  
heroku １８ (20から変更)

しかしまだ、下記のエラーがherokuのBuildlogに表示されております。  
どこに変更を加えれば良いのか、わかる方がおりましたら教えて下さい。

```

    -----> Building on the Heroku-18 stack
    -----> Determining which buildpack to use for this app
     !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
                Detected buildpacks: Ruby,Node.js
                See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
    -----> Ruby app detected
    -----> Installing bundler 2.2.33
    -----> Removing BUNDLED WITH version in the Gemfile.lock
    -----> Compiling Ruby/Rails
    -----> Using Ruby version: ruby-2.7.0
    -----> Installing dependencies using bundler 2.2.33
           Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
           Fetching gem metadata from https://rubygems.org/..........
    
     中略
    
         rm -rf "Release/sass.a" && cp -af "Release/obj.target/src/sass.a" "Release/sass.a"
         g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/app/.node-gyp/16.13.1/include/node -I/app/.node-gyp/16.13.1/src -I/app/.node-gyp/16.13.1/deps/openssl/config -I/app/.node-gyp/16.13.1/deps/openssl/openssl/include -I/app/.node-gyp/16.13.1/deps/uv/include -I/app/.node-gyp/16.13.1/deps/zlib -I/app/.node-gyp/16.13.1/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++14 -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
       In file included from /app/.node-gyp/16.13.1/include/node/v8.h:30:0,
                        from /app/.node-gyp/16.13.1/include/node/node.h:63,
                        from ../../nan/nan.h:58,
                        from ../src/binding.cpp:1:
       /app/.node-gyp/16.13.1/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’
                    !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                             ^~~~~~~~~~~
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: note: suggested alternative: ‘remove_cv’
                    !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                             ^~~~~~~~~~~
                                             remove_cv
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: note: suggested alternative: ‘remove_cv’
                    !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                             ^~~~~~~~~~~
                                             remove_cv
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:50: error: template argument 2 is invalid
                    !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                                         ^
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: error: ‘::Perform’ has not been declared
                    !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                                                      ^~~~~~~
       /app/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: note: suggested alternative: ‘herror’
                    !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                                                      ^~~~~~~
                                                                      herror
       binding.target.mk:133: recipe for target 'Release/obj.target/binding/src/binding.o' failed
       make: Leaving directory '/tmp/build_c404ad90/node_modules/node-sass/build'
       make: *** [Release/obj.target/binding/src/binding.o] Error 1
       gyp ERR! build error 
       gyp ERR! stack Error: `make` failed with exit code: 2
       gyp ERR! stack     at ChildProcess.onExit (/tmp/build_c404ad90/node_modules/node-gyp/lib/build.js:262:23)
       gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
       gyp ERR! System Linux 4.4.0-1101-aws
           gyp ERR! command "/tmp/build_c404ad90/bin/node" "/tmp/build_c404ad90/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
           gyp ERR! cwd /tmp/build_c404ad90/node_modules/node-sass
           gyp ERR! node -v v16.13.1
           gyp ERR! node-gyp -v v3.8.0
           gyp ERR! not ok 
           Build failed with error code: 1
     !
     !     Precompiling assets failed.
     !
     !     Push rejected, failed to compile Ruby app.
     !     Push failed
    Build finished
    heroku.com
    Blogs
    Careers
    Documentation
    Support
    
```
CC BY-SA 4.0
2022-03-20T03:06:12.227
87921
2022-03-20T05:35:26.643
2022-03-20T03:11:47.000
37468
37468
question
ruby-on-rails ruby heroku
railsアプリからherokuへのdeployでのエラー
古い node-sass だとこのエラーが出ることがあります。具体的には、node.js v16 には node-sass v6.0
以降でないと対応していません。

また node-sass が使っている LibSass が 2020 年 10 月から deprecated になっていて node-sass
もメンテナンスモードとなり、Dart Sass への乗り換えが推奨されています。

<https://github.com/sass/node-sass>
CC BY-SA 4.0
2022-03-20T05:35:26.643
87925
2022-03-20T05:35:26.643
19110
87921
answer