Ruby Heroku:由于gem文件,推送失败

Ruby Heroku:由于gem文件,推送失败,ruby,heroku,rubygems,bundler,Ruby,Heroku,Rubygems,Bundler,我有一个非常简单的应用程序,我正试图把它推给Heroku,但遇到了一些问题。我没有安装任何特殊的Gems,也没有做任何特殊的操作,但是在解析我的Gemfile时不断出现错误 我看到过添加Gem'rails\u 12factor'的示例,定义了Bundler版本、Ruby版本、更新Bundler、更新系统。执行这些修复后,错误不会改变。我最近安装了RailsInstaller,所以我正在运行所有内容的最新版本 这是我的Gemfile: source 'https://rubygems.org'

我有一个非常简单的应用程序,我正试图把它推给Heroku,但遇到了一些问题。我没有安装任何特殊的Gems,也没有做任何特殊的操作,但是在解析我的
Gemfile
时不断出现错误

我看到过添加Gem'rails\u 12factor'的示例,定义了Bundler版本、Ruby版本、更新Bundler、更新系统。执行这些修复后,错误不会改变。我最近安装了RailsInstaller,所以我正在运行所有内容的最新版本

这是我的
Gemfile

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

ruby '~> 2.3.3'
gem 'bundler', '~> 2.0.2'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.7'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and viewrubys
gem 'coffee-rails', '~> 4.2'
# 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', '~> 4.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',  '11.0.1'

  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'

  # Use sqlite3 as the database for Active Record
  gem "sqlite3", "~> 1.3.6"

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'
end

group :production do
  gem 'pg'
  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]
源代码'https://rubygems.org'
git_源(:github)do | repo_名称|
repo_name=“#{repo_name}/#{repo_name}”除非repo_name.include?(“/”)
"https://github.com/#{repo_name}.git“
终止
ruby“~>2.3.3”
gem“bundler”,“~>2.0.2”
#捆绑边缘Rails:gem'Rails',github'Rails/Rails'
gem'rails',“~>5.1.7”
#使用Puma作为应用程序服务器
宝石“彪马”,“大于3.7”
#将SCS用于样式表
gem'sass-rails',“~>5.0”
#使用Uglifier作为JavaScript资产的压缩器
gem'uglifier','>=1.3.0'
#看https://github.com/rails/execjs#readme 获取更多受支持的运行时
#宝石“therubyracer”,平台::ruby
#将CoffeeScript用于.coffee资产和ViewRuby
gem“咖啡轨”,“~>4.2”
#Turbolinks使web应用程序的导航速度更快。阅读更多:https://github.com/turbolinks/turbolinks
gem“涡轮链接”,“大于5”
#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder',“~>2.5”
#使用Redis适配器在生产中运行操作电缆
#gem'redis',“~>4.0”
#使用ActiveModel具有\u安全\u密码
#gem'bcrypt',“~>3.1.7”
#使用Capistrano进行部署
#gem“capistrano rails”,集团::开发
小组:开发,:测试
#在代码中的任意位置调用“byebug”以停止执行并获得调试器控制台
gem“byebug”,“11.0.1”
#增加了对Capybara系统测试和selenium驱动程序的支持
gem‘水豚’,“>=2.15”
gem“selenium webdriver”
#使用sqlite3作为活动记录的数据库
gem“sqlite3”,“大于1.3.6”
终止
小组:发展怎么办
#在异常页面上或通过使用代码中的任意位置访问IRB控制台。
gem“web控制台”,“>=3.3.0”
终止
小组:生产部
宝石“pg”
gem“rails_12factor”
终止
#Windows不包括zoneinfo文件,因此捆绑tzinfo数据
gem'tzinfo data',平台:[:mingw,:mswin,:x64_mingw,:jruby]
这是我遇到的错误:

$ git push herokustaging master
Enumerating objects: 300, done.
Counting objects: 100% (300/300), done.
Delta compression using up to 8 threads
Compressing objects: 100% (275/275), done.
Writing objects: 100% (300/300), 59.91 KiB | 1.50 MiB/s, done.
Total 300 (delta 96), 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:
remote:  !
remote:  !     There was an error parsing your Gemfile, we cannot continue
remote:  !     /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
remote:  !     from /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
remote:  !     from /tmp/d20190618-120-vf683l/bundler-2.0.1/bin/bundle:23:in `<main>'
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to sojournsb.
$git推送主机
枚举对象:300,完成。
计数对象:100%(300/300),完成。
增量压缩最多使用8个线程
压缩对象:100%(275/275),完成。
写入对象:100%(300/300),59.91kib | 1.50mib/s,完成。
总计300(增量96),重复使用0(增量0)
远程:正在压缩源文件。。。完成。
远程:建筑源:
远程:
遥控器:!警告:多个默认构建包报告了处理此应用的能力。将使用下面列表中的第一个构建包。
远程:检测到构建包:Ruby,Node.js
遥控器:参见https://devcenter.heroku.com/articles/buildpacks#buildpack-检测顺序
远程:-->检测到Ruby应用程序
远程:-->编译Ruby/Rails
远程:
遥控器:!
遥控器:!分析您的文件时出错,我们无法继续
遥控器:/app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816dee359c4f0f966b663a7f8649b07209d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/rubygems.rb:289:in'find_spec_-for_-for_-exe':找不到带可执行捆绑包的gem捆绑程序(>=0.a)(gem::gem::notfoundexception)
遥控器:!从/app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57eec358d71152b4fd2cf925c5b6e6816dee359c4f09f966b663a7f8649b072h59509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/rubygems.rb:308:在“激活”路径中
遥控器:!from/tmp/d20190618-120-vf683l/bundler-2.0.1/bin/bundle:23:in`'
遥控器:!
遥控器:!推送被拒绝,无法编译Ruby应用程序。
远程:
遥控器:!推送失败
远程:正在验证部署。。。
远程:
遥控器:!推住某人。

错误消息的相关部分显示为

can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
您不需要在Heroku上安装
bundler
,而且我不确定在
Gemfile
中安装bundler有多大帮助,即使在开发过程中也是如此。如果您没有Bundler,首先您将如何运行
bundle install


尝试从
Gemfile
(和
Gemfile.lock
)中取出
bundler
,然后重新部署。

我的问题是,我使用的是与Heroku不兼容的旧版本Ruby。我安装了最新版本的Ruby,并重建了我的应用程序。然后我成功地推到了Heroku

这是一件非常简单的事情,但是错误消息并不是完全有用

不管是谁,谢谢