dgb2021
dgb2021

Reputation: 71

You are trying to install ruby-2.6.3 on heroku-20

I have tried changing the gemfile to an earlier version and then pushing again but it does not seem to work. Here is the code. Any ideas?

Not sure I have posted in the correct format, this is my first SO post.

Any help would be appreciated, my command git push heroku master generates that output.

    Counting objects: 133, done.
    Compressing objects: 100% (109/109), done.
    Writing objects: 100% (133/133), 152.51 KiB | 3.81 MiB/s, done.
    Total 133 (delta 14), reused 0 (delta 0)
    remote: Compressing source files... done.
    remote: Building source:
    remote: 
    remote: -----> Building on the Heroku-20 stack
    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.3.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.3.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.3 on heroku-20.
    remote:  !     
    remote:  !     Ruby ruby-2.6.3 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: 5cf5d180a3b3f6f75291fac84f9be0b99d863efc
    remote:  !
    remote:  ! We have detected that you have triggered a build from source code with version 5cf5d180a3b3f6f75291fac84f9be0b99d863efc
    remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a enter code heredifferent 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 afternoon-garden-77939.
    remote: 
    To https://git.heroku.com/afternoon-garden-77939.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/afternoon-garden-77939.git'

Upvotes: 7

Views: 7986

Answers (4)

heroku stack:set heroku-18 --app your-app-name

Upvotes: 0

John Doe
John Doe

Reputation: 51

haohaobaozhi has the perfect answer here.

heroku stack:set heroku-18

I was having the same issue as OP and setting the stack to Heroku-18 solved the issue. This might be a common occurrence for those following the "Learn Enough Ruby On Rails To Be Dangerous" Book.

Upvotes: 5

haohaobaozhi
haohaobaozhi

Reputation: 341

heroku stack
heroku stack:set heroku-18

detail view https://devcenter.heroku.com/articles/stack

Upvotes: 24

Tin Nguyen
Tin Nguyen

Reputation: 5330

remote:  !     You are trying to install ruby-2.6.3 on heroku-20.
remote:  !     
remote:  !     Ruby ruby-2.6.3 is present on the following stacks:
remote:  !     
remote:  !     - cedar-14
remote:  !     - heroku-16
remote:  !     - heroku-18

Currently supported Ruby version for heroku-20 can be seen here:
https://devcenter.heroku.com/articles/ruby-support#supported-runtimes

2.6.6, Rubygems: 3.0.3
2.7.2, Rubygems: 3.1.4
3.0.0, Rubygems: 3.2.3

The list will change with time (new ubuntu/heroku releases, new Ruby versions release, ...)

Update your ruby version (and make sure your project is compatible with the new ruby version).

Upvotes: 1

Related Questions