首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >推送Heroku失败(Ruby 2.3.4)

推送Heroku失败(Ruby 2.3.4)
EN

Stack Overflow用户
提问于 2018-05-31 07:03:44
回答 3查看 3K关注 0票数 4

在尝试推送到heroku时,我一直收到这个错误。几天前没有任何问题,我也没有对我的gemfile进行任何更改。

这是我在推送到heroku时得到的错误。它显示“安装ruby-2.3.4时出错”,但我也没有在gem ruby-2.3.4中指定,所以没有像其他堆栈溢出答案所建议的那样注释掉这一行。

代码语言:javascript
复制
Stellas-MBP:curlav StellaHan$ git push heroku master
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.19 KiB | 0 bytes/s, done.
Total 9 (delta 7), reused 0 (delta 0)
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-18/ruby-2.3.4.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.4.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:  !
remote:  !     An error occurred while installing ruby-2.3.4
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-18/ruby-2.3.4.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 fierce-shore-32264.
remote:
To https://git.heroku.com/fierce-shore-32264.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fierce-shore-32264.git'

这是我的gemfile:

代码语言:javascript
复制
source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.3'
# Use Puma as the app server
gem 'puma', '~> 3.0'
gem 'pg', '~> 0.20'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platform: :mri
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :production do
  gem 'rails_12factor'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'bootstrap-sass', '~> 3.3.7'
gem 'devise', '~> 4.2'

gem 'toastr-rails', "~> 1.0"

gem 'omniauth', '~> 1.6'
gem 'omniauth-facebook', '~> 4.0'
gem 'paperclip', '~> 5.1.0'
gem 'geocoder'

gem 'jquery-ui-rails', '~> 5.0'
gem 'momentjs-rails', '~> 2.17.1'

gem 'ransack', '~> 1.7'
gem 'twilio-ruby', '~> 4.11.1'
gem 'fullcalendar-rails', '~> 3.4.0'

gem 'stripe', '~> 3.0.0'
gem 'rails-assets-card', source: 'https://rails-assets.org'

gem 'omniauth-stripe-connect', '~> 2.10.0'
gem 'jquery-timepicker-addon-rails'

gem 'boxr'
gem 'redis', '~> 3.0'
gem 'aws-sdk', '~> 2.8'

EN

回答 3

Stack Overflow用户

发布于 2018-05-31 09:29:42

Heroku现在需要Ruby版本2.4.4,所以我不得不将其包含到Gemfile中。

在gem文件的顶部包含以下内容: ruby "2.4.4“

有关更多详细信息,请参阅本文:https://devcenter.heroku.com/articles/ruby-support#ruby-versions

票数 8
EN

Stack Overflow用户

发布于 2019-07-14 21:28:37

你的ruby版本2.3.4将不再支持Heroku-18。你应该使用heroku的老版本Heroku-14。

使用此命令切换到Heroku-14

heroku堆栈:设置cedar-14 -a您的应用程序名称

票数 1
EN

Stack Overflow用户

发布于 2018-12-28 03:32:26

如果您在gemfile中将其从已有的任何版本更新为可接受的版本,则在尝试运行bundlebundle install时可能会出现以下问题

Your Ruby version is 2.3.3, but your Gemfile specified 2.4.5

您可以运行下面的命令。

如果您使用的是rvm:

rvm install 2.5.3 rvm use 2.5.3

有关其他解决方案,请查看下面的解决方案。

结帐:

How to fix “Your Ruby version is 2.3.0, but your Gemfile specified 2.2.5” while server starting

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50614448

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档