部署Elovation乒乓ELO系统到Heroku时Ruby应用编译失败如何解决
办公室乒乓球ELO积分系统部署报错求助
我打算使用elovation开源项目搭建一套适用于办公室乒乓球赛事的趣味ELO积分系统。
找到这个项目时我非常开心,本以为部署会很简单,结果遇到了报错问题。
我尝试通过谷歌搜索解决方案,但所有结果都涉及命令行操作、编辑Gemfile、执行bundle install命令这类操作来修复。我完全搞不懂怎么按照README文件说明的流程完成这些操作,现在非常崩溃。
安装表单中有一个RAILS_ENV变量设置为"production",我不知道是否需要修改,也不知道要改成什么值。我接触科技产品不算完全的新手,但我觉得我可能漏了什么非常简单的步骤。如果能获得帮助我会非常感谢,谢谢!
首次报错日志
-----> Building on the Heroku-20 stack -----> Determining which buildpack to use for this app -----> Ruby app detected -----> Installing bundler 1.17.3 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails 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-20/ruby-2.4.0.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3. 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-20/ruby-2.4.0.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3. ! ! The Ruby version you are trying to install does not exist on this stack. ! ! You are trying to install ruby-2.4.0 on heroku-20. ! ! Ruby ruby-2.4.0 is present on the following stacks: ! ! - heroku-18 ! ! Heroku recommends you use the latest supported Ruby version listed here: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes ! ! For more information on syntax for declaring a Ruby version see: ! https://devcenter.heroku.com/articles/ruby-versions ! ! Push rejected, failed to compile Ruby app. ! Push failed
补充信息
补充1:当前操作页面截图

补充2:降级Heroku stack后操作日志
我尝试了网友给出的方案:
正如报错所示,项目配置使用的旧版Ruby不受当前Heroku stack支持。你可以将dyno降级为旧版heroku-18 stack,或是升级elovation使用的Ruby版本。降级到heroku-18可能是最简单的方案,但请注意elovation已停止维护,多个依赖存在安全漏洞。
操作后仍然遇到了几乎一样的报错,完整操作日志如下:
Last login: Sat Nov 20 07:26:34 on ttys000 jakejohnson@Jakes-MacBook-Pro ~ % heroku login heroku: Press any key to open up the browser to login or q to exit: Opening browser to https://cli-auth.heroku.com/auth/cli/browser/ce7a8998-d5dd-4406-acd5-8f086d1f5e31?requestor=SFMyNTY.g2gDbQAAAA43My4xNjMuMTQ5LjIzN24GAGiTXD19AWIAAVGA.7u7MiKZ6EBv_y9C1X9aom-tXUK8itfOM-_EJEzD8moU Logging in... done Logged in as mynameisjacobj@gmail.com jakejohnson@Jakes-MacBook-Pro ~ % heroku create --stack heroku-18 Creating app... done, ⬢ floating-reaches-04486, stack is heroku-18 https://floating-reaches-04486.herokuapp.com/ | https://git.heroku.com/floating-reaches-04486.git jakejohnson@Jakes-MacBook-Pro ~ % cd ~/Desktop/nextphasepong jakejohnson@Jakes-MacBook-Pro nextphasepong % git init Reinitialized existing Git repository in /Users/jakejohnson/Desktop/nextphasepong/.git/ jakejohnson@Jakes-MacBook-Pro nextphasepong % heroku git:remote -a nextphasepong set git remote heroku to https://git.heroku.com/nextphasepong.git jakejohnson@Jakes-MacBook-Pro nextphasepong % git add . jakejohnson@Jakes-MacBook-Pro nextphasepong % git commit -am "work dammit" On branch master nothing to commit, working tree clean jakejohnson@Jakes-MacBook-Pro nextphasepong % git push heroku master Enumerating objects: 180, done. Counting objects: 100% (180/180), done. Delta compression using up to 12 threads Compressing objects: 100% (164/164), done. Writing objects: 100% (180/180), 68.05 KiB | 3.58 MiB/s, done. Total 180 (delta 11), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Determining which buildpack to use for this app remote: -----> Ruby app detected remote: -----> Installing bundler 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock 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-20/ruby-2.4.0.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-20/ruby-2.4.0.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3. remote: remote: ! remote: ! The Ruby version you are trying to install does not exist on this stack. remote: ! remote: ! You are trying to install ruby-2.4.0 on heroku-20. remote: ! remote: ! Ruby ruby-2.4.0 is present on the following stacks: remote: ! remote: ! - heroku-18 remote: ! remote: ! Heroku recommends you use the latest supported Ruby version listed here: remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes remote: ! remote: ! For more information on syntax for declaring a Ruby version see: remote: ! https://devcenter.heroku.com/articles/ruby-versions remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to nextphasepong. remote: To https://git.heroku.com/nextphasepong.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/nextphasepong.git' jakejohnson@Jakes-MacBook-Pro nextphasepong %
补充3:诉求
我已经尝试了数个小时仍未解决,希望可以获得详细的分步部署指引,万分感谢。
内容的提问来源于stack exchange,提问作者Jacob Johnson
相关产品推荐
相关产品推荐

