前提・実現したいこと
Rails Tutorialを進めており、Herokuにデプロイするところで詰まっています。
gitにcommitし、herokuにpushした際にエラーが起こりました。
学習し始めたばかりで理解不足かもしれませんがよろしくお願いいたします。
発生している問題・エラーメッセージ
ubuntu:~/environment/sample_app (master) $ git push heroku master Counting objects: 113, done. Compressing objects: 100% (95/95), done. Writing objects: 100% (113/113), 56.48 KiB | 2.09 MiB/s, done. Total 113 (delta 9), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Determining which buildpack to use for this app remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. remote: Detected buildpacks: Ruby,Node.js remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order remote: -----> Ruby app detected remote: -----> Installing bundler 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.6.6 remote: -----> Installing dependencies using bundler 1.17.3 remote: 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 remote: 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`. remote: Fetching gem metadata from https://rubygems.org/........... remote: Fetching rake 12.3.3 remote: Installing rake 12.3.3 remote: Fetching concurrent-ruby 1.1.9 remote: Fetching thread_safe 0.3.6 ーーー途中省略ーーー remote: Fetching rails 6.0.3 remote: Fetching webpacker 4.0.7 remote: Fetching sass-rails 5.1.0 remote: Installing rails 6.0.3 remote: Installing sass-rails 5.1.0 remote: Installing webpacker 4.0.7 remote: Bundle complete! 23 Gemfile dependencies, 60 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into `./vendor/bundle` remote: Post-install message from sass: remote: remote: Ruby Sass has reached end-of-life and should no longer be used. remote: remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new remote: primary implementation: https://sass-lang.com/install remote: remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the remote: sassc gem: https://github.com/sass/sassc-ruby#readme remote: remote: * For more details, please refer to the Sass blog: remote: https://sass-lang.com/blog/posts/7828841 remote: remote: Bundle completed (37.36s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v12.16.2-linux-x64 remote: -----> Installing yarn-v1.22.4 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: yarn install v1.22.4 remote: [1/4] Resolving packages... remote: [2/4] Fetching packages... remote: info fsevents@2.3.2: The platform "linux" is incompatible with this module. remote: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. remote: [3/4] Linking dependencies... remote: warning " > webpack-dev-server@4.3.0" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0". remote: warning "webpack-dev-server > webpack-dev-middleware@5.2.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". remote: [4/4] Building fresh packages... remote: Done in 5.78s. remote: I, [2021-10-02T02:02:18.263445 #1070] INFO -- : Writing /tmp/build_d1931b29/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css remote: I, [2021-10-02T02:02:18.264168 #1070] INFO -- : Writing /tmp/build_d1931b29/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz remote: Compiling… remote: Compilation failed: remote: error Command "webpack" not found. remote: remote: yarn run v1.22.4 remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. remote: remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: e800f4f40580c10d2e52b16ba8de8e7c6a4ec2b5 remote: ! remote: ! We have detected that you have triggered a build from source code with version e800f4f40580c10d2e52b16ba8de8e7c6a4ec2b5 remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to polar-lake-23526. remote: To https://git.heroku.com/polar-lake-23526.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/polar-lake-23526.git'
試したこと
・gemを一度uninstallし、bundle installでGemfile.lockを生成し直してみました。
・AWS cloud9で新しい環境を作り、初めから作り直しましたが、同じエラーに当たりました。
・gem listを見てみるとbundlerが二つありました、これも原因の一つなのでしょうか?
bundler (default: 1.17.2, 1.17.1)
補足情報(FW/ツールのバージョンなど)
・macOS
・rails 6.0.3
・ruby 2.6.3p62 (2019-04-16 revision 67580) x86_64-linux
回答1件
あなたの回答
tips
プレビュー