heroku / heroku/heroku-buildpack-ruby
Possible Bundler 2.5.6 Issues
- Dominant language
- Ruby
- Stars
- 785
- Forks
- 1.8k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
Description
Deploys for our app were fine one Feb 27th, but have been failing since Feb 28th. We cannot deploy the git ref that successfully deployed on Feb 27th. My suspicion was that this might be caused by a change in the ruby buildpack, since it doesn't seem to relate to a change in the codebase.
The step that is failing is the `Detecting rake tasks`. It fails like this:
```
-----> Detecting rake tasks
!
! Could not detect rake tasks
! ensure you can run `$ bundle exec rake -P` against your app
! and using the production group of your Gemfile.
! fatal: not a git repository (or any parent up to mount point /)
! Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
! /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/definition.rb:480:in `materialize': Could not find mini_portile2-2.8.5 in any of the sources (Bundler::GemNotFound)
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/definition.rb:185:in `specs'
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/definition.rb:233:in `specs_for'
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:18:in `setup'
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler.rb:150:in `setup'
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/setup.rb:20:in `block in '
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/ui/shell.rb:136:in `with_level'
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/ui/shell.rb:88:in `silence'
! from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/setup.rb:20:in `'
! from :85:in `require'
! from :85:in `require'
! from /tmp/build_af31c9ce/config/boot.rb:3:in `'
! from /tmp/build_af31c9ce/bin/rake:2:in `require_relative'
! from /tmp/build_af31c9ce/bin/rake:2:in `'
!
/tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:100:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
/tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/definition.rb:480:in `materialize': Could not find mini_portile2-2.8.5 in any of the sources (Bundler::GemNotFound)
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/definition.rb:185:in `specs'
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/definition.rb:233:in `specs_for'
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/runtime.rb:18:in `setup'
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler.rb:150:in `setup'
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/setup.rb:20:in `block in '
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/ui/shell.rb:136:in `with_level'
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/ui/shell.rb:88:in `silence'
from /tmp/build_af31c9ce/vendor/ruby-3.0.6/lib/ruby/3.0.0/bundler/setup.rb:20:in `'
from :85:in `require'
from :85:in `require'
from /tmp/build_af31c9ce/config/boot.rb:3:in `'
from /tmp/build_af31c9ce/bin/rake:2:in `require_relative'
from /tmp/build_af31c9ce/bin/rake:2:in `'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:981:in `rake'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:69:in `block in run_assets_precompile_rake_task'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:175:in `log'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:63:in `run_assets_precompile_rake_task'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:103:in `block in compile'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1002:in `allow_git'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:96:in `compile'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails2.rb:55:in `compile'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails3.rb:37:in `compile'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:30:in `compile'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails6.rb:17:in `compile'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:19:in `block in '
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:175:in `log'
from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:18:in `'
! Push rejected, failed to compile Ruby app.
! Push failed
```
I can install the gems locally with exactly the same command that is listed in the logs (`BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4`) and run `bundle exec rake -P` as the logs indicate and cannot reproduce the issue locally.
My assumption is that this issue is related to [this change](https://devcenter.heroku.com/articles/bundler-version#bundler-2-4-22-and-2-5-6), because when I employ the workaround listed there, I am able to deploy and the build started failing alongside that change.
I'm not exactly sure how to proceed, as I don't really know how to debug this.
Ruby version: 3.0.6
Rails version: 6.1.7.6
Stack: Heroku-20
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Ruby buildpack's rake-task detection path and the Bundler 2.5.6 change linked in the issue. Reproduce with Ruby 3.0.6, Rails 6.1.7.6, Heroku-20, and the production bundle settings, then compare the failing `bundle exec rake -P` run with the documented workaround. Done means the reported deployment failure is reproduced and a verified buildpack fix or cause is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100