Help us understand the problem. What is going on with this article?

rails5のプロジェクトをHerokuにデプロイしたときにCould not detect rake tasksとなる

開発環境

ruby 2.4.4
rails 5.2.3

起こったこと

rails5のプロジェクトをHerokuにデプロイするときに以下のエラーが起きる

#ターミナル
git push heroku master

と打ち込んでデプロイしようとしたら

remote:        Bundle completed (45.17s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v10.15.3-linux-x64
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) - did find: [bundler-2.0.2]
remote:  !     Checked in 'GEM_PATH=vendor/bundle/ruby/2.4.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:  !

対処法

エラーメッセージを見るとbundlerのバージョン2.0.1が見つからないらしい。
そこでbundlerのバージョン2.0.2をローカルでインストールしてみる。

gem install bundler -v 2.0.2

忘れずにbundlerのアップデートもしておく。

bundle update --bunlder

あとは変更があったのでgitにコミットしてからHerokuにデプロイする。

git add -A
git commit -m "update bundler"
git push heroku master

これでうまくいきました!

参考ページ

https://qiita.com/satouwork0316/items/a738392bcab03bac657a

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away