I made changed to a Ruby on Rails app using Ruby 3.0.5. I forgot that I had changed the app setting to upgrade the stack from Heroku-20 to Heroku-22 on the next build. When I tried to upload my changes I saw the following in the terminal after executing git push heroku master
:
remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.4.22
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://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-22/ruby-3.0.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://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-22/ruby-3.0.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-3.0.5 on heroku-22.
remote: !
remote: ! Ruby ruby-3.0.5 is present on the following stacks:
remote: !
remote: ! - heroku-20
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: Verifying deploy...
remote:
remote: ! Push rejected to myapp.
remote:
To https://git.heroku.com/lightbe.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
I removed that stack update request to go back to Heroku-20. I tried again and saw this in my terminal after executing git push heroku master
:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.4.22
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.0.5
remote: -----> Installing dependencies using bundler 2.4.22
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Fetching gem metadata from https://rubygems.org/..........
remote: ffi-1.17.0-x86_64-linux requires rubygems version >= 3.3.22, which is
remote: incompatible with the current version, 3.2.33
remote: Bundler Output: Fetching gem metadata from https://rubygems.org/..........
remote: ffi-1.17.0-x86_64-linux requires rubygems version >= 3.3.22, which is
remote: incompatible with the current version, 3.2.33
remote:
remote: !
remote: ! Failed to install gems via Bundler.
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: reallyinsanelylongcode
remote: !
remote: ! We have detected that you have triggered a build from source code with version reallyinsanelylongcodewitanextradigit
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 myapp.
remote:
To https://git.heroku.com/lightbe.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
I tried to clear the build cache (desperate to find something):
https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache
It appears that there’s a master branch for both stacks. I couldn’t find a command to empty a heroku repository and start over.
How do I get rid of the one for stack Heroku-22?