Heroku:错误推送Rails应用程序到Heroku,Heroku找不到Rails应用程序

 慌瓜 发布于 2022-12-12 22:05

我试图将Rails应用程序推送到Heroku但是我经常遇到这个错误.

user$ git push heroku master
Initializing repository, done.
Counting objects: 158, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (144/144), done.
Writing objects: 100% (158/158), 671.52 KiB | 160.00 KiB/s, done.
Total 158 (delta 32), reused 0 (delta 0)

-----> Ruby app detected
-----> Compiling Ruby/Rails
 !
 !     An error occurred while installing Ruby ruby-2.1.1
 !     For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
 !     Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14
 !     Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.1.1.tgz -s -o - | tar zxf - ' failed unexpectedly:
 !     
 !     gzip: stdin: unexpected end of file
 !     tar: Child returned status 1
 !     tar: Error is not recoverable: exiting now
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:user.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:user.git'

我研究了一些可能的解决方案,但是这些解决方案似乎都没有用.我试图销毁heroku应用程序,然后重新创建它,我尝试使用不同的ruby版本,但似乎也没有工作.

1 个回答
  • Heroku不支持2.1.1版

    https://devcenter.heroku.com/articles/ruby-support#supported-runtimes

    您需要在Gemfile中指定不同的版本:

    # Gemfile
    source "https://rubygems.org"
    ruby '2.1.4' # or other from link above
    
    [...]
    

    2022-12-12 22:20 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有