Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku-18:Git推送失败。显示Ruby on push的不同版本_Ruby_Heroku_Rubygems - Fatal编程技术网

Heroku-18:Git推送失败。显示Ruby on push的不同版本

Heroku-18:Git推送失败。显示Ruby on push的不同版本,ruby,heroku,rubygems,Ruby,Heroku,Rubygems,如果这是一个愚蠢的问题,我很抱歉。我对Ruby一点都不熟悉。还尝试了来自SO的几种解决方案。设法升级Ruby,解决依赖关系。现在只是卡住了,无法前进。感谢您的帮助。 多谢各位 推送时,我得到了ruby v2.2.2,但我刚刚升级到heroku-18支持的2.5.7。 以下是CLI记录: remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --m

如果这是一个愚蠢的问题,我很抱歉。我对Ruby一点都不熟悉。还尝试了来自SO的几种解决方案。设法升级Ruby,解决依赖关系。现在只是卡住了,无法前进。感谢您的帮助。 多谢各位

推送时,我得到了ruby v2.2.2,但我刚刚升级到heroku-18支持的2.5.7。 以下是CLI记录:

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]

您的遥控器中有两个应用程序当前被git引用。
只需在push命令中指定应用程序名称

git push ... --app appname-heroku18

在我看来,您已经锁定了Ruby版本。这就是为什么它一直试图安装Ruby 2.2.2。默认情况下,它应该只选择一个稳定的Ruby版本

查看
Gemfile
中的
ruby
条目。在那里应该是
2.2.2
。删除它或将版本锁定到
2.5.7

->git push heroku master#我在我的应用程序中运行了此操作,并收到了应用程序的错误消息。 我检查了“/git/”下的“config”文件,它显示了2个应用程序:

[remote "origin"]
    url = https://git.heroku.com/yinow.git
    fetch = +refs/heads/*:refs/remotes/origin/*
# [remote "heroku"]
#   url = https://git.heroku.com/yinow.git
#   fetch = +refs/heads/*:refs/remotes/heroku/***
我如上所述注释掉“heroku”部分,然后再次像这样运行push命令:

->git推送源主机


问题解决了

欢迎来到SO!我建议你读一读。这有点长,但很值得花时间。他正在推正确的git遥控器。错误显示他的本地git repo设置了2个git Remote。每个git遥控器都指向不同的应用程序。Afaik在一个git remote中不可能有两个应用程序。他正在推送至正确的应用程序/远程查看
错误:未能将某些参考推送至'https://git.heroku.com/appname-heroku18.git“
但它仍在尝试在该远程设备上安装ruby-2.2.2。可能是因为他在源代码中指定了要安装的ruby版本。Nope。我确信我的Gemfile和lock文件中有2.5.7。如果你发现自己对多个问题留下了相同的答案,这可能意味着其中一个问题是另一个问题的重复。