Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'
like image 565
dgb2021 Avatar asked Dec 02 '22 08:12

dgb2021


2 Answers

heroku stack
heroku stack:set heroku-18

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

like image 128
haohaobaozhi Avatar answered Dec 04 '22 00:12

haohaobaozhi


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.

like image 34
John Doe Avatar answered Dec 03 '22 22:12

John Doe