mizumanjyu
@mizumanjyu (み み)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

The git repository at 'ディレクトリ' has too many active changes, only a subset of Git features will be enabled.が出る

解決したいこと

実行環境 OS:Windows10,AWS cloud9,

Railsチュートリアル第1章を行っているherokuインストールコマンド

$ source <(curl -sL https://cdn.learnenough.com/heroku_install)

実行後、下記の様にポップアップアラートがでます。
これが原因なのか分かりませんが、git push heroku masterでデプロイに失敗したりしている気がします。

image.png

The git repository at 'ディレクトリ' has too many active changes, only a subset of Git features will be enabled.

herokuのエラーログは下記の通り

自分で試したこと

今まで行ったエラー修復作業は、的外れだとは思いますが。

GitHubとHerokuとAWSのアカウントを新しく作成し、新しい環境で作業をしてみました。

エラー内容を一つ一つ読み取り、自分で理解して回復するべきだとは思いますが今現在の状況で質問させてください。よろしくお願いいたします。

-----> Building on the Heroku-20 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 1.17.3
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.7.4
-----> Installing dependencies using bundler 1.17.3
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4
       The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
       Fetching gem metadata from https://rubygems.org/............
       Fetching rake 12.3.3
       Installing rake 12.3.3
       Fetching concurrent-ruby 1.1.9
       Fetching minitest 5.14.4
       Fetching thread_safe 0.3.6
       Installing minitest 5.14.4
       Installing concurrent-ruby 1.1.9
       Installing thread_safe 0.3.6
       Fetching zeitwerk 2.4.2
       Installing zeitwerk 2.4.2
       Fetching builder 3.2.4
       Installing builder 3.2.4
       Fetching erubi 1.10.0
       Installing erubi 1.10.0
       Fetching mini_portile2 2.6.1
       Fetching racc 1.5.2
       Installing mini_portile2 2.6.1
       Fetching crass 1.0.6
       Installing crass 1.0.6
       Installing racc 1.5.2 with native extensions
       Fetching rack 2.2.3
       Fetching nio4r 2.5.8
       Installing rack 2.2.3
       Installing nio4r 2.5.8 with native extensions
       Fetching websocket-extensions 0.1.5
       Installing websocket-extensions 0.1.5
       Fetching mini_mime 1.1.2
       Installing mini_mime 1.1.2
       Fetching msgpack 1.4.2
       Installing msgpack 1.4.2 with native extensions
       Using bundler 2.1.4
       Fetching ffi 1.15.4
       Installing ffi 1.15.4 with native extensions
       Fetching method_source 1.0.0
       Installing method_source 1.0.0
       Fetching pg 1.1.4
       Installing pg 1.1.4 with native extensions
       Fetching thor 1.1.0
       Installing thor 1.1.0
       Fetching rb-fsevent 0.11.0
       Installing rb-fsevent 0.11.0
       Fetching tilt 2.0.10
       Installing tilt 2.0.10
       Fetching turbolinks-source 5.2.0
       Installing turbolinks-source 5.2.0
       Fetching tzinfo 1.2.9
       Installing tzinfo 1.2.9
       Fetching i18n 1.8.10
       Installing i18n 1.8.10
       Fetching rack-test 1.1.0
       Installing rack-test 1.1.0
       Fetching rack-proxy 0.7.0
       Installing rack-proxy 0.7.0
       Fetching sprockets 3.7.2
       Installing sprockets 3.7.2
       Fetching websocket-driver 0.7.5
       Installing websocket-driver 0.7.5 with native extensions
       Fetching mail 2.7.1
       Installing mail 2.7.1
       Fetching puma 4.3.6
       Installing puma 4.3.6 with native extensions
       Fetching nokogiri 1.12.5 (x86_64-linux)
       Installing nokogiri 1.12.5 (x86_64-linux)
       Fetching bootsnap 1.4.5
       Installing bootsnap 1.4.5 with native extensions
       Fetching turbolinks 5.2.0
       Installing turbolinks 5.2.0
       Fetching activesupport 6.0.3
       Installing activesupport 6.0.3
       Fetching rb-inotify 0.10.1
       Installing rb-inotify 0.10.1
       Fetching loofah 2.12.0
       Installing loofah 2.12.0
       Fetching mimemagic 0.3.10
       Installing mimemagic 0.3.10 with native extensions
       Fetching rails-dom-testing 2.0.3
       Installing rails-dom-testing 2.0.3
       Fetching globalid 0.5.2
       Installing globalid 0.5.2
       Fetching activemodel 6.0.3
       Installing activemodel 6.0.3
       Fetching jbuilder 2.9.1
       Installing jbuilder 2.9.1
       Fetching sass-listen 4.0.0
       Installing sass-listen 4.0.0
       Fetching rails-html-sanitizer 1.4.2
       Installing rails-html-sanitizer 1.4.2
       Fetching activejob 6.0.3
       Installing activejob 6.0.3
       Fetching activerecord 6.0.3
       Installing activerecord 6.0.3
       Fetching sass 3.7.4
       Installing sass 3.7.4
       Fetching actionview 6.0.3
       Installing actionview 6.0.3
       Fetching marcel 0.3.3
       Installing marcel 0.3.3
       Fetching actionpack 6.0.3
       Installing actionpack 6.0.3
       Fetching actioncable 6.0.3
       Fetching activestorage 6.0.3
       Fetching actionmailer 6.0.3
       Installing actionmailer 6.0.3
       Installing actioncable 6.0.3
       Installing activestorage 6.0.3
       Fetching railties 6.0.3
       Installing railties 6.0.3
       Fetching sprockets-rails 3.2.2
       Fetching actionmailbox 6.0.3
       Installing actionmailbox 6.0.3
       Installing sprockets-rails 3.2.2
       Fetching actiontext 6.0.3
       Installing actiontext 6.0.3
       Fetching rails 6.0.3
       Fetching sass-rails 5.1.0
       Fetching webpacker 4.0.7
       Installing rails 6.0.3
       Installing webpacker 4.0.7
       Installing sass-rails 5.1.0
       Bundle complete! 18 Gemfile dependencies, 60 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into `./vendor/bundle`
       Post-install message from sass:

       Ruby Sass has reached end-of-life and should no longer be used.

       * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
         primary implementation: https://sass-lang.com/install

       * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
         sassc gem: https://github.com/sass/sassc-ruby#readme

       * For more details, please refer to the Sass blog:
         https://sass-lang.com/blog/posts/7828841

       Removing bundler (1.17.3)
       Bundle completed (36.80s)
       Cleaning up the bundler cache.
-----> Installing node-v12.16.2-linux-x64
-----> Installing yarn-v1.22.4
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       yarn install v1.22.4
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@2.3.2: The platform "linux" is incompatible with this module.
       info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       warning " > webpack-dev-server@4.3.1" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0".
       warning "webpack-dev-server > webpack-dev-middleware@5.2.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
       [4/4] Building fresh packages...
       Done in 5.06s.
       I, [2021-10-18T22:11:22.168363 #1074]  INFO -- : Writing /tmp/build_57c8c69e/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css
       I, [2021-10-18T22:11:22.168817 #1074]  INFO -- : Writing /tmp/build_57c8c69e/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz
       Compiling…
       Compilation failed:
       error Command "webpack" not found.

       yarn run v1.22.4
       info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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

1Answer

The git repository at 'ディレクトリ' has too many active changes, only a subset of Git features will be enabled.

このメッセージで検索すれば出てくると思いますが、 Git で管理されていないファイルやファイル内の変更が多すぎるせいで、エディタの Git プラグインの動作が制限されている状態です。変更をコミットするなり .gitignore でファイルを無視するなり設定すれば解消します。

Heroku で出ているエラーはそれとは関係なく、 webpack コマンドが存在しないせいです。 Rails アプリケーションのディレクトリに package.json があり、その中に "webpack-cli": "バージョン番号" と書かれていれば正常ですが、ないかもしれません。なければ yarn add -D webpack-cli を実行し、 package.json と yarn.lock に加わった変更をコミットしてから再度 Heroku にデプロイしてください。

1Like

Your answer might help someone💌