Ruby Heroku部署失败:此版本的Ruby在Heroku-18上不可用。如何升级我的ruby版本并使部署成功?

时间:2019-01-29 10:39:05

标签: ruby heroku

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

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

我正在运行命令:

performance-schema=0
symbolic-links=0
performance-schema=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-storage-engine=MyISAM
innodb_file_per_table=1
max_allowed_packet=268435456
open_files_limit=10000
innodb_buffer_pool_size = 256M
#tmp_table_size = 50M
#max_heap_table_size = 40M
join_buffer_size= 256K
query_cache_size = 128M
query_cache_type = 1

但是,出现以下错误:

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:  !

2 个答案:

答案 0 :(得分:0)

Heroku不支持Ruby 2.3.3

  

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

     

MRI:

     
      
  • 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

答案 1 :(得分:0)

在此链接https://devcenter.heroku.com/articles/ruby-support#supported-runtimes中查看红宝石的最新版本

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

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

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

这解决了我的问题