前提・実現したいこと
railsアプリケーションを作成しており、Herokuでデプロイしようとするとエラーが出ました。
エラーを解消し、デプロイできるようにしたいです。
発生している問題・エラーメッセージ
$ git push heroku master <省略> 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 2.1.4 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.5.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3. remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.5.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3. remote: remote: ! remote: ! The Ruby version you are trying to install does not exist on this stack. remote: ! remote: ! You are trying to install ruby-2.6.5 on heroku-20. remote: ! remote: ! Ruby ruby-2.6.5 is present on the following stacks: remote: ! remote: ! - cedar-14 remote: ! - heroku-16 remote: ! - heroku-18 remote: ! remote: ! Heroku recommends you use the latest supported Ruby version listed here: remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes remote: ! remote: ! For more information on syntax for declaring a Ruby version see: remote: ! https://devcenter.heroku.com/articles/ruby-versions 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: a63ec93e7648323a70388b9e8f3c43c88777f899 remote: ! remote: ! We have detected that you have triggered a build from source code with version a63ec93e7648323a70388b9e8f3c43c88777f899 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 cafe-log. remote: To https://git.heroku.com/cafe-log.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/cafe-log.git'
該当のソースコード
ソースコード
試したこと
$ heroku stack:set heroku-16
上記のコマンドを実行し再度、herokuへpushしました。
発生している問題・エラーメッセージ
git push heroku master <省略> remote: -----> Building on the Heroku-16 stack 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: _ _ __ __ ______ ____ _ remote: | | | | /_ | / / | ____/ __ \| | remote: | |__ ___ _ __ ___ | | ___ _ ______| |/ /_ | |__ | | | | | remote: | '_ \ / _ \ '__/ _ \| |/ / | | |______| | '_ \ | __|| | | | | remote: | | | | __/ | | (_) | <| |_| | | | (_) | | |___| |__| | |____ remote: |_| |_|\___|_| \___/|_|\_\__,_| |_|\___/ |______\____/|______| remote: remote: This app is using the Heroku-16 stack, which is deprecated: remote: https://devcenter.heroku.com/changelog-items/1958 remote: remote: From May 1st 2021, Heroku-16 will be end-of-life, and apps using it remote: will no longer receive security updates, and be run at your own risk. remote: remote: From June 1st 2021, builds will no longer be allowed for Heroku-16 apps remote: remote: Please upgrade to a newer stack as soon as possible: remote: https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack remote: https://help.heroku.com/0S5P41DC/heroku-16-end-of-life-faq remote: remote: ! remote: ! ## Warning - The same version of this code has already been built: a63ec93e7648323a70388b9e8f3c43c88777f899 remote: ! remote: ! We have detected that you have triggered a build from source code with version a63ec93e7648323a70388b9e8f3c43c88777f899 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... done. To https://git.heroku.com/cafe-log.git * [new branch] master -> master
このような状態になっており、対処方法がわかりません。
ご教授のほどよろしくお願いします。
補足情報(FW/ツールのバージョンなど)
ruby '2.6.5'
gem 'rails', '~> 6.0.0'
gem 'mysql2', '>= 0.4.4'
https://teratail.com/questions/316025 と内容が重複しているのでこちらの質問は削除してください。
あなたの回答
tips
プレビュー