Ruby on rails Ruby 2.6.1和Bundler 2.0.1给Heroku:我应该写一个Procfile吗?

Ruby on rails Ruby 2.6.1和Bundler 2.0.1给Heroku:我应该写一个Procfile吗?,ruby-on-rails,ruby,heroku,rake,bundler,Ruby On Rails,Ruby,Heroku,Rake,Bundler,我在尝试将应用程序部署到Heroku时遇到了无法处理的错误。这是我第一次 # ERROR when I try to `git push heroku master` remote: -----> Detecting rake tasks remote: remote: ! remote: ! Could not detect rake tasks remote: ! ensure you can run `$ bundle exec rake -P` agains

我在尝试将应用程序部署到Heroku时遇到了无法处理的错误。这是我第一次

# ERROR when I try to `git push heroku master`
remote: -----> Detecting rake tasks
remote: 
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     Activating bundler (2.0.1) failed:
remote:  !     Could not find 'bundler' (2.0.1) required by your /tmp/build_e569680f858939ef8f1f8ef3e8902eff/Gemfile.lock.
remote:  !     To update to the latest version installed on your system, run `bundle update --bundler`.
remote:  !     To install the missing version, run `gem install bundler:2.0.1`
remote:  !     Checked in 'GEM_PATH=/tmp/build_e569680f858939ef8f1f8ef3e8902eff/vendor/bundle/ruby/2.6.0', execute `gem env` for more information
remote:  !     
remote:  !     To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'
我尝试过几种解决方案,如:

running RAILS_ENV=生产包执行rake资产:预编译请参阅

添加RAILS\u SERVE\u STATIC\u文件键相同

将Ruby升级到2.6.3请参阅,无法找到使用rbenv或rvm的2.6.3

我相信这可能是因为。我是否关心这一点

2当使用binstubs而不是bundle exec运行命令时,错误的 当使用Ruby 2.6.x时,Bundler版本可以被激活。这个虫子 报告给Ruby Core,并将在Ruby 2.6.3启用时修复 释放

短期内,解决方法是确保 Procfile和app.json以bundle exec开头。例如:

web:bundle exec bin/rails服务器-p$PORT-e$rails\u ENV

辅助程序:bundle exec sidekiq-C config/sidekiq.yml

作为一个新手,我感到很失落,有人能帮我吗

谢谢你的时间

解决方案:在Gemfile中找到删除捆绑的和以下行。lock

有,包括这一行:

指定bundler 2.0.2的Gemfile.lock不适用于bundler 2.0.1

如果您试图将使用bundler 2.0.2的应用程序部署到带有bundler 2.0.1的Heroku平台上,您可能会遇到以下错误:

`find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
这是由于Rubygems捆绑包版本检查代码中的错误造成的。要避免此问题,请升级您的Ruby版本。它固定在2.5.5+和2.6.3+中。如果您不更新Ruby版本,那么Bundler 2.x的每一个新版本都会触发此问题

在本地将Ruby升级到至少2.6.3版本,在Gemfile中更新Ruby版本,捆绑安装,提交更改,然后重新部署

# Gemfile.lock
RUBY VERSION
   ruby 2.6.1p33

BUNDLED WITH
   2.0.1
`find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)