Home>

When the rails app is deployed on Heroku (git push heroku master)
The following error message occurred:

Error message
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_a5a1935abed158bbe82fd9d1750698db/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 = vendor/bundle/ruby ​​/ 2.5.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'`
remote:!


As far as I see the error message, it says that I want to change the bundler version to 2.0.1, but

BUNDLED WITH
   2.0.1


So I am confused.

When you rungit push heroku master

$git push heroku master
Enumerating objects: 198, done.
Counting objects: 100% (198/198), done.
Delta compression using up to 4 threads
Compressing objects: 100% (169/169), done.
Writing objects: 100% (198/198), 48.33 KiB | 1.24 MiB/s, done.
Total 198 (delta 24), 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: ----->Using Ruby version: ruby-2.5.1
remote: ----->Installing dependencies using bundler 2.0.2
remote: Running: bundle install --without development: test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
remote: Fetching gem metadata from https: //rubygems.org/............

Installing dependencies using bundler 2.0.2may be a problem
It cannot be resolved.

Thank you Professor Prof. Takataka.

Uninstall bundler

Supplemental information (FW/tool version etc.)

ruby ​​2.5.1
rails 5.2.3

  • Answer # 1

    If you search Google for error messages, you will find several articles about this issue.

    $brew update&&brew upgrade ruby-build
    $rbenv install 2.6.3
    $rbenv local 2.6.3
    $gem install bundler -v 2.0.2
    $rm Gemfile.lock
    $bundle install
    $git add .ruby-version Gemfile Gemfile.lock
    $git commit -m 'version up ruby'
    $git push heroku master

    [memo] Could not find 'bundler' (2.0.1) at Heroku
    https://qiita.com/amuyikam/items/989300248f471020ca18