首页 > 解决方案 > Rails v6.0.0 推送到 Heroku 失败 - Rake & Bundler 错误消息

问题描述

这是我第一次尝试将 Rails v6.0.0 应用程序推送到 Heroku。错误消息是:

Could not detect rake tasks
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
Activating bundler (2.0.1) failed:
Could not find 'bundler' (2.0.1) required by your /tmp/build_94b6a9e04d812c465a5480f59429532e/Gemfile.lock.
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.1`
Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'`

建议?

标签: rakebundlerruby-on-rails-6

解决方案


bundler repo 上的一个类似错误报告提到bundler 2.0.1与 heroku 冲突。我从该评论中复制了以下修复说明:

  • gem install bundler -v 2.0.2
  • bundle update --bundler
  • 在您的仓库中提交并推送 Gemfile.lock 更改
  • 部署git push heroku master

推荐阅读