7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

herokuデプロイでエラー Could not detect rake tasks

Posted at

###エラーが起きました。

とりあえずherokuにデプロイ
ターミナル

$ heroku login --interactive
$ heroku keys:add
$ heroku create
$ git push heroku master  ←ここでエラー発生

エラーが発生してハマりました。

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_fd30c4777777788888990ad7e4/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'`

この怒りの文章w

###こちらを参考にしました。

こちらの記事を参考にしました。

###対処法

rubyとbundlerのバージョンを上げる

$ 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      gemfileのrubyの記述を2.6.3に変更しないとエラーになる。

githubでコミット、プッシュしてから

$ git push heroku

で無事デプロイ完了できました。

気をつけます。

7
4
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
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?