LoginSignup
1
0

More than 3 years have passed since last update.

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

Last updated at Posted at 2019-07-21

開発環境

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

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

参考ページ

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0