简体   繁体   中英

Pushing to Heroku fails due to unsupported Ruby version even after Gemfile was changed

I'm trying to push a forked repo to Heroku but Heroku won't accept the push because Ruby 2.3.1 wasn't accepted. I changed the version to 2.3.3 in the Gemfile and running bundle install --without production , but oddly enough it was still considered to be 2.3.1. The same things happened even after trying other Ruby versions, such as 2.4.0.

Reference:

$ cat Gemfile.lock | grep -A 2 RUBY
RUBY VERSION
ruby 2.3.3p222
$ bundle platform --ruby
ruby 2.3.3p222

Error:

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-18/ruby-2.3.1.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.1.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:
remote:  !
remote:  !     An error occurred while installing ruby-2.3.1
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

Gemfile:

# -*- mode: ruby; -*-
source 'https://rubygems.org'
ruby '2.3.3'

# basic app components
gem 'pg', '~> 0.21'
gem 'apartment', '>= 2.1.0'     # multi-tenancy: see README.md
gem 'rails', '4.2.9'
gem 'rack-timeout'              # prevent Heroku dynos from hanging up on timeout

gem 'where-or'                  # backport from Rails 5; remove when upgrading

gem 'builder'
gem 'bundler'
gem 'figaro'
gem 'sslrequirement'
gem 'haml'
gem 'gibbon'
gem 'i18n'
gem 'jbuilder', '~> 2.0'
gem 'jquery-rails', '= 4.0.5'
gem 'jquery-ui-rails', '= 5.0.5'
gem 'nokogiri'
gem 'pothoven-attachment_fu'
gem 'protected_attributes'      # remove once we migrate to Strong Parameters
gem 'responders', '~> 2.0'
gem 'attr_encrypted'            # attr_encrypted must load AFTER protected_attributes (https://github.com/attr-encrypted/attr_encrypted/issues/107)
gem 'rake'
gem 'stripe'
gem 'will_paginate'

# asset pipeline
gem 'sprockets-rails', :require => 'sprockets/railtie'
gem 'uglifier'
gem 'sassc-rails'

group :production do
  gem 'newrelic_rpm'
  gem 'puma-heroku'
  gem 'puma'
  gem 'rails_12factor'
end

group :test do
  gem 'cucumber', '~> 2.0'
  gem 'cucumber-rails', '1.5.0', :require => false
  gem 'capybara'
  gem 'fake_stripe'
  gem 'poltergeist'
  gem 'rspec-its'
  gem 'rspec-html-matchers'
  gem 'simplecov', :require => false
  gem 'spring'                  # for 'guard'
  gem 'webmock'
  gem 'vcr'
end

group :development do
  gem 'derailed_benchmarks'
  # gem 'query_trail'
  gem 'ruby-prof'
  gem 'stackprof'
  gem 'web-console', '~> 2.0'
  gem 'spring-commands-rspec'   # for use with Guard
end

group :development, :test do
  # the following really belong in a separate 'staging' environment
  gem 'faker', :git => 'https://github.com/armandofox/faker' # needed in production too,for adding fake data to staging server
  gem 'factory_bot_rails'                                    # used by fake_data stuff

  gem 'bullet'
  # cucumber and capybara
  gem 'yaml_db', :git => 'https://github.com/armandofox/yaml_db'
  gem 'byebug'                  # 4
  gem 'pry'
  gem 'listen', '~> 2.2'
  gem 'guard-rspec', :require => false
  gem 'guard-cucumber'
  gem 'minitest'
  gem 'faye-websocket'
  gem 'database_cleaner'
  gem 'rb-readline'
  gem 'rubyzip'
  gem 'mime-types'
  gem 'chronic'
  gem 'fakeweb'
  gem 'launchy'
  gem 'rack-test'
  gem 'sdoc', '~> 0.4.0'
  gem 'coveralls', :require => false
  gem 'rspec-rails'
  gem 'rspec-collection_matchers' # should have(n).items, etc
  gem 'rspec-activemodel-mocks'   # mock_model(Customer), etc
  gem 'sqlite3'
  gem 'timecop'
  gem 'traceroute'
end

Heroku doesn't support Ruby 2.3.1, 2.3.3 or 2.4.0

Look at your log:

remote:  !     An error occurred while installing ruby-2.3.1
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

Look at the link from your log :

Heroku supports the following Ruby versions and the associated Rubygems. A supported version means that you can expect our tools and platform to work with a given version. It also means you can receive technical support. Here are our supported Ruby versions:

MRI:

  • 2.4.5 : patchlevel 335, Rubygems: 2.6.14.4
  • 2.5.5: patchlevel 157, Rubygems: 2.7.6.2
  • 2.6.2: patchlevel 33, Rubygems: 3.0.3

Also read information how to specify Ruby version .

Pay special attention to the Troubleshooting section. Looks like you didn't commit your Gemfile and Gemfile.lock after changing Ruby version and before pushing to Heroku.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM