Deploy to Heroku button failing to deploy
The "Deploy to Heroku" button on the REAME page isn't working.
It seems like the problem lays with stack/buildpack selection in Heroku.
A full log is provided below:
-----> 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 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
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.
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.
!
! The Ruby version you are trying to install does not exist on this stack.
!
! You are trying to install ruby-2.6.5 on heroku-20.
!
! Ruby ruby-2.6.5 is present on the following stacks:
!
! - heroku-18
!
! Heroku recommends you use the latest supported Ruby version listed here:
! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
!
! For more information on syntax for declaring a Ruby version see:
! https://devcenter.heroku.com/articles/ruby-versions
!
! Push rejected, failed to compile Ruby app.
! Push failed
Hi @mpoli
The log says, that you try to use ruby-2.6.5 on heroku-20 stack (which is default now), but that version of Ruby is not supported on heroku-20. It suggest to use the older heroku-18 stack, instead of default heroku-20
You can find the solution on this link https://stackoverflow.com/questions/66279424/you-are-trying-to-install-ruby-2-6-3-on-heroku-20
This command should show you, which stack is default (heroku-20) $ heroku stack
This will switch your default stack to heroku-18 for all new apps $ heroku stack:set heroku-18
If you want to use heroku-18 only for one app, this --app switch should work $ heroku stack:set heroku-18 --app your-app-name
Currently supported Ruby versions for heroku-20 can be seen here: https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
More info about stacks and stack EOL is available on https://devcenter.heroku.com/articles/stack
To fix the 'deploy to Heroku' button, the maintainers need to upgrade ruby version to the supported one from the ruby list in heroku-20 stack
Did this instructions fix your problem?