heroku push of Rails 3.2 app suddenly fails with "Could not detect rake tasks" (no other errors)

221 views Asked by At

I changed nothing in the configuration (no new gems or version changes); just one line of code, but I am now unable to push to heroku. Something must have changed at heroku?

It is Rails 3.2.22.5; Ruby 2.3.1. (Yes, I'm in the middle of upgrading to Rails 5, but it's a huge job, and in the meantime I still need to maintain the existing production system.)

RAILS_ENV=production bundle exec rake -P works fine. I don't think it's really a rake issue. My best guess is something changed at heroku such that some version of something I have is no longer supported, but I have no idea what. And I'm not getting any informative error messages.

At a loss... I've Googled extensively, but most of the posts are 4+ years old. I tried precompiling locally and checking in only the manifest file. I tried upgrading rake (from 13.0.0 to 13.0.1), and have since put everything back since nothing worked.

remote:        Bundle complete! 54 Gemfile dependencies, 118 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (0.51s)
remote:        Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: -----> Installing node-v12.16.2-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:  !     bash: /tmp/build_785c3bf77f08cff81f442938e3386876/bin/rake: /app/vendor/ruby-2.3.1/bin/ruby: bad interpreter: No such file or directory
remote:  !
remote: /tmp/buildpackvv7B3/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
1

There are 1 answers

0
user3407688 On

I asked heroku support, and they found the problem. Nothing to do with rake or my project itself, as expected (since I hadn't changed anything).

It had to do with the buildpacks. I need a PDF-generator, so I had a "multi-buildpack" set up (done years ago), apparently in a way that's no longer supported. I believe the proximate cause was pointing to a "master" buildpack, instead of the stable release. So somebody checked something in at heroku, and it broke my project :) It would probably only affect people who'd done set it up years ago, on the old cedar stack, as I did.

I ran:

heroku buildpacks:remove https://github.com/heroku/heroku-buildpack-multi.git
heroku buildpacks:add heroku/ruby
heroku buildpacks:add https://github.com/dscout/wkhtmltopdf-buildpack.git

and was able to deploy again!