heroku push error: “Could not detect rake tasks”

I had the same issue and it Turns out that I had installed the latest bundler version (bundler-2.2.1)
You can check your bundler version by:

  • bundle version

Heroku seems to work well with bundler version 2.1.4. (not sure why)
In my case I had to downgrade to version 2.1.4 and make it the default.

In my Ubuntu 20.10 When I type:

  • gem uninstall bundler

It uninstalls bundler version 2.2.1 and I am left with bundler version 2.1.4 which is then declared as the default gem and can’t be uninstalled and that’s exactly what I wanted. So after that I went to my rails app,

  • Deleted Gemfile.lock
  • bundle install
  • git add .
  • git commit -m “Modified Gemfile.lock”
  • git push origin master
  • git push heroku master

And everything worked perfectly.

Leave a Comment