问题
My apologies if this is a dumb question. I am not familiar with anything about Ruby. Also tried several solutions from SO. Managed to upgrade Ruby, resolve dependencies. Now just stuck and not able to move ahead. Any help is appreciated. Thank you.
When I push, I get ruby v2.2.2 but I just upgraded to 2.5.7 which is supported by heroku-18. Here are CLI records:
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-18/ruby-2.2.2.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-18/ruby-2.2.2.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:
remote: !
remote: ! An error occurred while installing ruby-2.2.2
remote: !
remote: ! This version of Ruby is not available on Heroku-18. The minimum supported version
remote: ! of Ruby on the Heroku-18 stack can found at:
remote: !
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to appname-heroku18.
remote:
To https://git.heroku.com/appname-heroku18.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appname-heroku18.git'
Mac-Air:appname developer$ ruby -v
ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin18]
Mac-Air:appname developer$ heroku run ruby -v
› Error: Multiple apps in git remotes
› Usage: --remote heroku-18
› or: --app appname-heroku18
› Your local git repository has more than 1 app referenced in git
› remotes.
› Because of this, we can't determine which app you want to run this
› command against.
› Specify the app you want with --app or --remote.
› Heroku remotes in repo:
› appname (heroku)
› appname-heroku18 (heroku-18)
›
› https://devcenter.heroku.com/articles/multiple-environments
Mac-Air:appname developer$ heroku run ruby -v --remote
› Error: Flag --remote expects a value
Mac-Air:appname developer$ heroku run ruby -v --remote heroku
Running ruby -v on ⬢ appname... up, run.1515 (Free)
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
Mac-Air:appname developer$ heroku run ruby -v --remote heroku-18
Running ruby -v on ⬢ appname-heroku18... up, run.1012 (Free)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
Mac-Air:appname developer$ heroku run ruby -v --app appname-heroku18
Running ruby -v on ⬢ appanme-heroku18... up, run.6356 (Free)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
回答1:
you have two apps in your remote that is currently referenced by your git.
just specify the app name in your push command.
git push ... --app appname-heroku18
回答2:
It seems to me that you have locked the Ruby version. That's why it keeps trying to install Ruby 2.2.2. By default it should just pick a stable Ruby version.
Look into your Gemfile
for a ruby
entry. There it should say 2.2.2
. Either remove it or lock the version to 2.5.7
.
来源:https://stackoverflow.com/questions/60404874/heroku-18-git-push-fails-showing-different-versions-of-ruby-on-push