【问题标题】:Ruby Heroku deployment failing: This version of Ruby is not available on Heroku-18. How can I upgrade my ruby version and make the deployment succeed?Ruby Heroku 部署失败:此版本的 Ruby 在 Heroku-18 上不可用。如何升级我的 ruby​​ 版本并使部署成功?
【发布时间】:2019-09-21 04:33:27
【问题描述】:

在 Mac OS High Sierra 上升级 Ruby 最有效的方法是什么?

我正在尝试将我的简单 Ruby 应用程序部署到 Heroku。

我正在运行命令:

git push heroku master

但是,我收到以下错误:

18:11 $ git push heroku master
Counting objects: 97, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (82/82), done.
Writing objects: 100% (97/97), 22.59 KiB | 1.88 MiB/s, done.
Total 97 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     Warning: Multiple default buildpacks reported the ability to 
handle this app. The first buildpack in the list below will be used.
remote:                         Detected buildpacks: Ruby,Node.js
remote:                         See 
https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
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-18/ruby-2.3.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-18/ruby-2.3.3.tgz -s -o - | tar 
zxf - ' failed on attempt 2 of 3.
remote:
remote:  !
remote:  !     An error occurred while installing ruby-2.3.3
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 morning-plains-67699.
remote: 
To https://git.heroku.com/morning-plains-67699.git
! [remote rejected] master -> master (pre-receivehook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-plains- 
67699.git'

【问题讨论】:

标签: ruby heroku


【解决方案1】:

Heroku 不支持 Ruby 2.3.3

Heroku 支持以下 Ruby 版本和相关的 Rubygems。受支持的版本意味着您可以期望我们的工具和平台与给定版本一起使用。这也意味着您可以获得技术支持。以下是我们支持的 Ruby 版本:

核磁共振:

  • 2.4.5:补丁级别 335,Rubygems:2.6.14.3
  • 2.5.3:补丁级别 105,Rubygems:2.7.6
  • 2.6.0:补丁级别 0,Rubygems:3.0.1

Read at Heroku

另请阅读信息how to specify Ruby version

【讨论】:

  • 我已经更新到 2.6.0 版,更新了我的 gemfile,重新生成了 gemlock 文件,但我仍然遇到同样的错误。
  • 你在这个操作之后提交了吗?
  • 不...我会在提交后尝试推送到heroku。
  • 提交有帮助吗?
  • 很遗憾没有
【解决方案2】:

在这个链接https://devcenter.heroku.com/articles/ruby-support#supported-runtimes查看最新版本的ruby

然后运行最新的rvm install ruby-2.4.6

在终端中输入ruby -v,您应该会看到 ruby​​ 2.4.6。

如果它仍然显示 ruby​​ 2.0.,请运行 rvm use ruby-2.4.6 --default

更改 gem 文件中的 ruby​​ 版本,然后捆绑

这解决了我的问题

【讨论】:

    猜你喜欢
    • 2020-03-21
    • 1970-01-01
    • 2014-01-14
    • 1970-01-01
    • 2019-05-31
    • 1970-01-01
    • 2021-08-25
    • 2017-04-02
    • 2017-08-28
    相关资源
    最近更新 更多