[英]Is it possible to run my Rails app on Heroku with Ruby 1.9.3? If so, how?
[英]Heroku Keeps tying to install Ruby 1.9.3 even after I upgrade my app to 2.5.1
我刚刚从Heroky升级了旧应用程序,然后在轨道上运行红宝石。 我将ruby 1.9.3升级到2.5.1,并将rails 3.2升级到5.2.0。
然后,我在Heroku上创建了一个新应用并尝试进行部署,但是我不断收到一条错误消息,指出Heroku无法安装1.9.3。
这是错误日志:
remote: Compressing source files... done.
remote: Building source:
remote:
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-16/ruby-1.9.3-p551.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-16/ruby-1.9.3-p551.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote: !
remote: ! An error occurred while installing ruby-1.9.3-p551
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: !
remote: ! Debug InformationCommand: '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-16/ruby-1.9.3-p551.tgz -s -o - | tar zxf - ' failed unexpectedly:
remote: !
remote: ! gzip: stdin: unexpected end of file
remote: ! tar: Child returned status 1
remote: ! tar: Error is not recoverable: exiting now
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to nbmen-staging.
remote:
To https://git.heroku.com/nbmen-staging.git
! [remote rejected] master -> master (pre-receive hook declined)
在我的Gemfile中,我有:
source 'https://rubygems.org'
ruby '2.5.1'
gem 'rails', '5.2.0'
在Gemfile.lock中,我有:Ruby版本红宝石2.5.1p57
BUNDLED WITH
1.16.1
还有一个.rbenv版本文件,我将内容从1.9.3更改为2.5.1。
而且我仍然收到“安装ruby-1.9.3-p551时发生错误”消息。 我想念什么?
似乎您可能拥有旧的/未发布的heroku buildpack,因为捆绑软件版本未在您的版本中输出(因此您可能正在使用旧的bulder版本)。
我本来希望看到的是:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.1
-----> Installing dependencies using bundler 1.15.2
...
要检查您的buildpack:
$ heroku buildpacks
=> heroku/ruby
如果没有输出heroku/ruby
,那么您正在运行一个旧的/未发布的buildpack
要安装最新的buildpack:
heroku buildpacks:set heroku/ruby
有关更多信息: https : //devcenter.heroku.com/articles/bundler-version
Ruby版本文件现在称为.ruby-version
。
您拥有的文件称为.rbenv-version
。 这是一个旧名称,不再受支持。
您可以尝试重命名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.