rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 2k forks source link

You must use Bundler 2 or greater with this lockfile #6784

Closed tz3tzis closed 5 years ago

tz3tzis commented 5 years ago

I try to upload my rails app to heroku but i get this error.

remote: /tmp/d20181113-113-10miq1y/bundler-1.15.2/gems/bundler-1.15.2/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError) From what i understand my bundler version (Bundler version 2.0.0.pre.1) is different than the one in heroku (Bundler 1.15.x)

What can i do to change that? Please help me!

deivid-rodriguez commented 5 years ago

Ugggh, you'd need to run gem install bundler -v 2.0.0.pre1 before this error happens, but I'm not sure if you can do this on heroku right now... For now, you can downgrade your bundler version to 1.17.1 and regenerate your lock file. I think

gem install bundler -v 1.17.1
gem uninstall bundler -v 2.0.0.pre1
bundle update --bundler

should do the trick.

@bundler/maintainers This seems no good? :thinking:. Maybe bundle install should automatically install and exec to the locked version in the lock file?

indirect commented 5 years ago

For the time being, it is possible to use Bundler 2 via this buildpack: https://github.com/bundler/heroku-buildpack-bundler2. You can set your Heroku app to use that buildpack like this:

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

We are working with Heroku to provide Bundler 2 as part of the official Heroku buildpack, but it will take some time.

deivid-rodriguez commented 5 years ago

Nice! Still, I wonder if it's a good idea that bundle install automatically installs and use the locked version of bundler in the lock file?

tz3tzis commented 5 years ago

thanks a lot for the quick reply guys!

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

did it for me!

shukhrat2001 commented 5 years ago

Thanks! This also worked for me.

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

thomasbromehead commented 5 years ago

Thanks a gazillion!!!

GTMHS commented 5 years ago

Thanks! This also worked for me.

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

alxekb commented 5 years ago

Also try this: https://bundler.io/blog/2019/01/03/announcing-bundler-2.html

crystal-wb commented 5 years ago

I followed the guides and added the bundler 2 buildpack. It's even in the settings page for the app on heroku under buildpacks. But my app still won't build. -----> Auto detecting buildpacks... Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order-----> Ruby app detected ! ! You must use Bundler 2 or greater with this lockfile. ! /tmp/d20190108-60-1qh81v9/bundler-1.15.2/gems/bundler-1.15.2/lib/bundler/lockfile_parser.rb:108:inwarn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError) from /tmp/d20190108-60-1qh81v9/bundler-1.15.2/gems/bundler-1.15.2/lib/bundler/lockfile_parser.rb:95:in initialize' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:130:innew' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:130:in block in parse_gemfile_lock' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:inblock (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in yield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:inblock in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in realtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:ininstrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:86:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:128:inparse_gemfile_lock' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:112:in lockfile_parser' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:74:inspecs' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:59:in block in gem_version' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:inblock (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in yield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:inblock in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in realtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:ininstrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:86:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:58:ingem_version' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails5.rb:9:in block in use?' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:inblock (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in yield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:inblock in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in realtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:ininstrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails5.rb:8:inuse?' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:17:in block (2 levels) in detect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:16:ineach' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:16:in detect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:16:inblock in detect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in block (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:inyield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in block in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:inrealtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:13:indetect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_test-compile:23:in block in <main>' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:35:inblock in trace' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in block (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:inyield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in block in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:inrealtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:35:intrace' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_test-compile:22:in <main>' I can find no answers.

alxekb commented 5 years ago

I followed the guides and added the bundler 2 buildpack. It's even in the settings page for the app on heroku under buildpacks. But my app still won't build. -----> Auto detecting buildpacks... Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order-----> Ruby app detected ! ! You must use Bundler 2 or greater with this lockfile. ! /tmp/d20190108-60-1qh81v9/bundler-1.15.2/gems/bundler-1.15.2/lib/bundler/lockfile_parser.rb:108:inwarn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError) from /tmp/d20190108-60-1qh81v9/bundler-1.15.2/gems/bundler-1.15.2/lib/bundler/lockfile_parser.rb:95:in initialize' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:130:innew' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:130:in block in parse_gemfile_lock' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:inblock (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in yield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:inblock in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in realtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:ininstrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:86:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:128:inparse_gemfile_lock' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:112:in lockfile_parser' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:74:inspecs' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:59:in block in gem_version' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:inblock (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in yield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:inblock in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in realtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:ininstrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:86:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/bundler_wrapper.rb:58:ingem_version' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails5.rb:9:in block in use?' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:inblock (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:in yield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:inblock in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:in realtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:ininstrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/base.rb:48:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/rails5.rb:8:inuse?' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:17:in block (2 levels) in detect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:16:ineach' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:16:in detect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:16:inblock in detect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in block (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:inyield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in block in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:inrealtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack.rb:13:indetect' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_test-compile:23:in block in <main>' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:35:inblock in trace' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:18:in block (2 levels) in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:40:inyield_with_block_depth' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:17:in block in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/benchmark.rb:308:inrealtime' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:16:in instrument' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/instrument.rb:35:intrace' from /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_test-compile:22:in <main>' I can find no answers.

Please restart the terminal.

crystal-wb commented 5 years ago

Please restart the terminal.

Restarting didn't help. I decided to revert back to the version Heroku uses and leave it as that till Heroku updates their version of bundler. Thank you for trying to help.

shala88 commented 5 years ago

Hi Im new to coding and am working on a project with The Odin Project I did every thing right but towards the end the error message "You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError" keeps coming up. Its so frustrating. Is there something wrong with GitHub or Heroku? What can I do to solve this? Everything is up to date and I also used the updated heroku link. Please help!!!!!

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

screen shot 2019-01-12 at 10 38 29 am
shukhrat2001 commented 5 years ago

Just you this command before deploying to Heroku. You should get a message from Heroku that the buildpack is set

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

On Sat, Jan 12, 2019 at 12:42 PM shala88 notifications@github.com wrote:

Hi Im new to coding and am working on a project with The Odin Project I did every thing right but towards the end the error message "You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError" keeps coming up. Its so frustrating. Is there something wrong with GitHub or Heroku? What can I do to solve this? Everything is up to date and I also used the updated heroku link. Please help!!!!!

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

[image: screen shot 2019-01-12 at 10 38 29 am] https://user-images.githubusercontent.com/46071697/51077090-02725280-1667-11e9-9a44-cfdf638663a6.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bundler/bundler/issues/6784#issuecomment-453771355, or mute the thread https://github.com/notifications/unsubscribe-auth/AGESPNt4hk_hJE-27z56g14qkI1FDxBLks5vCiyMgaJpZM4Ychxd .

-- Shuhrat Negmatov

railsfactory-pavan commented 5 years ago

Problem: Traceback (most recent call last): 5: from bin/rails:3:in <main>' 4: from bin/rails:3:inload' 3: from /home/shubham/work_station/jobg/bin/spring:10:in <top (required)>' 2: from /home/shubham/work_station/jobg/bin/spring:10:innew' 1: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in initialize' /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:inwarn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)

Solution: remove Gemfile.lock then , rails s

More at: https://bundler.io/blog/2019/01/03/announcing-bundler-2.html

ikeshavgiri commented 5 years ago

try gem update --system

Kamenan12 commented 5 years ago

Slu me still I have the same problem on my Windows because despite all the attempted solutions I can not add my projects on heroku, always the problem of bundler, I made the update to bundler, my esl version> = 2 but when I push it's the same I do not know why! I tried https://bundler.io/blog/2019/01/03/announcing-bundler-2.html but it's the same problem is the bundle! my version of ruby is 2.5.3 rails is 5.22

Kamenan12 commented 5 years ago

https://stollerys.co.uk/2019/01/12/you-must-use-bundler-2-or-greater-with-this-lockfile.html

schneems commented 5 years ago

Hello. I work for Heroku and maintain the Ruby buildpack. I currently recommend uninstalling bundler 2 locally and updating your Gemfile.lock to show that the BUNDLE WITH is 1.17.3:

BUNDLED WITH
   1.17.3

This error is due to the rubygems/bundler integration, an issue is here https://github.com/rubygems/rubygems/issues/2592.

I've had several customers attempt to use https://github.com/bundler/heroku-buildpack-bundler2 and have run into errors. If you do use that buildpack know that Heroku does not officially provide support for any third party buildpack.

I am working on a way to provide a bundler 2.x version in the future. Currently, we are blocked on getting bundler 1.17.3 released due to a discrepancy with jruby in 1.9.3 mode and TLS. It works on bundler 1.15.2 but fails on 1.17.3.

In the meantime, I recommend not having bundler 2 in your Gemfile.lock.

hsbt commented 5 years ago

@schneems Thanks to your work with Bundler support.

Currently, we are blocked on getting bundler 1.17.3 released due to a discrepancy with jruby in 1.9.3 mode and TLS. It works on bundler 1.15.2 but fails on 1.17.3.

Do you have the public issue/ticket about its problem?

rayana commented 5 years ago

Thanks for the heads-up @schneems ! I uninstalled bundler 2 and installed v. 1 back -- it worked just fine.

Here's a quick link to the documentation with instructions to downgrade to Bundler 1 https://bundler.io/v2.0/guides/bundler_2_upgrade.html#what-happens-if-my-application-needs-bundler-1-but-i-only-have-bundler-2-installed

schneems commented 5 years ago

@hsbt

Do you have the public issue/ticket about its problem?

Unfortunately I was unable to find a change entry or the specific commit where the behavior changed in bundler or rubygems.

This is the current best guess for that specific issue: The problem is that apparently in bundler 1.15.2 if a cert did not verify it would fall back to http instead of https. Then rubygems.org started accepting only TLS 1.3. Our build of jruby doesn't support this version. When you try to build on older bundler versions it works fine, but on 1.17.3 you get the "retry" error message a few times and it fails while trying to first connect to rubygems.org.

The user can work around it by removing https from their source, though that's obviously not a good solution. It looks like the way we package JRuby can be changed to allow it to work with bundler 1.17.3.

salmanwaheed commented 5 years ago

Only below thing works for me

  1. rm -rf Gemfile.lock
  2. bundle update
muneebaahmad commented 5 years ago

Updating the version on my Gemfile.lock didn't work for me. Here's what did work:

Go to heroku.com in your browser. Go to your app. Then go to Settings. In Buildpacks click the button "Add buildpack" and enter this url: https://github.com/bundler/heroku-buildpack-bundler2

Now do git push heroku master and it should go through.

It worked for me!

delacruzjames commented 5 years ago

@schneems correct the best way is to update your bundler version on your gemfile.lock

abaird commented 5 years ago

@schneems - I tried what you suggested above, downgrading to bundler 1.17.3, removing the Gemfile.lock, re-generating it with the 1.17.3 version of bundler and then attempting to push up to heroku master. This failed because Could not find 'bundler' (< 2) - did find: [bundler-2.0.1]. Do I need to do something to re-initialize my Heroku environment to support bundler v1?

schneems commented 5 years ago

I don’t recommend deleting the Gemfile.lock. Just editing it. What does it say at the bottom in the “BUNDLED WITH” section now that you’ve made your modifications? Did you commit back to git after you made your changes?

delacruzjames commented 5 years ago

@schneems - I tried what you suggested above, downgrading to bundler 1.17.3, removing the Gemfile.lock, re-generating it with the 1.17.3 version of bundler and then attempting to push up to heroku master. This failed because Could not find 'bundler' (< 2) - did find: [bundler-2.0.1]. Do I need to do something to re-initialize my Heroku environment to support bundler v1?

schneems commented 5 years ago

Previously I thought this behavior was limited to Rubygems 3+ (https://github.com/rubygems/rubygems/issues/2592) but now i'm realizing that the lockfile parser in Bundler 1.x is where this error is being raised.

Similar to https://github.com/rubygems/rubygems/issues/2592 since there's no actual discrepancy with Bundler 2.x lockfile and Bundler 1.x there's no current reason to raise this error right now. Can we backport an "escape valve" that will allow people to opt out of this error and release it in 1.17 ? There's not any technical reason that bundler 1.15 or 1.17 cannot execute a bundler 2.0.1 Gemfile.lock.

indirect commented 5 years ago

@schneems the intention was that both Bundler 1.x and 2.x could be installed at the same time, and RubyGems would give you the correct version on execution of any bundle command. Is it not possible for Heroku to have both Bundler 1.17 and 2.0 installed at the same time for some reason?

schneems commented 5 years ago

@indirect This is the solution I'm moving forward with on the buildpack https://github.com/heroku/heroku-buildpack-ruby/pull/850.

This solution inspects the Gemfile.lock and pulls the appropriate major version. I.e. 1.x will get 1.15.2 and 2.x will get 2.0.1 (for now). I'll merge early next week, then if there are no major issues, I can likely deploy to all apps a week from Monday.

Is it not possible for Heroku to have both Bundler 1.17 and 2.0 installed at the same time for some reason?

One of the issues with letting bundler decide which version to execute is that the buildpack uses the lockfile parser, which is the component that raises the exception on this issue. We can only require one specific version into the codebase so we have to know what major version of bundler we'll need to use anyway.

When we initially talked about how this was going to roll out it was my understanding that bundler 1.x could still execute and install a Gemfile.lock built with 2.0 and that the only thing that was changed was "jump" logic which I thought was isolated to the bundler codebase. That would give time to prepare the patch as described above. When I talked with Colby we've always thought there was a need to inspect the Gemfile.lock and download the appropriate bundler version.

indirect commented 5 years ago

That seems like a good solution. Sorry for the miscommunication about the lockfile parser; I thought that the version switching inside RubyGems would be usable by the buildpack as well.

cre-o commented 5 years ago

Why just not use gem update bundler? For update ruby environment to use bundler 2?

brentgreeff commented 5 years ago

This command: heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2

Seems to have wiped out my previous command: heroku buildpacks:add --index 1 heroku/nodejs

I was getting a webpack error, could not figure it out until I ran heroku buildpacks

I had 2 ruby buildpacks and the nodejs one was awol.

schneems commented 5 years ago

Heroku now supports Bundler 2 https://devcenter.heroku.com/changelog-items/1563

schneems commented 5 years ago

One reported issue. Even with bundler 2 on the system this error still happens when deploying an app with Ruby 2.6 since Ruby 2.6 ships with a default version of bundler.

https://github.com/heroku/heroku-buildpack-ruby/issues/856

Update: The issue is limited to Ruby 2.6.0. Please upgrade to Ruby 2.6.1 to avoid this issue.

brentgreeff commented 5 years ago

Deployments were working OK for me with the bundler buildpack but I could not load the heroku console. I switched to the standard heroku ruby pack, but I still have the same issue:

heroku console -r production Running console on ⬢ policymogul-production... up, run.9121 (Standard-1X) You must use Bundler 2 or greater with this lockfile.

I reverted to:

BUNDLED WITH 1.17.2

in Gemfile.lock

Seems its not ready for prime time.

schneems commented 5 years ago

@brentgreeff are you using Ruby 2.6.0? If so, can you try with Ruby 2.6.1?

dawidlenkiewicz commented 5 years ago

Can confirm it works with Ruby 2.6.1

schneems commented 5 years ago

I tested the "bundler 2" third party buildpack with Ruby 2.6.0 and confirms that fails in the same way https://github.com/heroku/heroku-buildpack-ruby/issues/856#issuecomment-465619756

I suggest people migrate to Heroku's officially supported buildpack heroku/ruby and upgrade to Ruby 2.6.1 if they're currently using 2.6.0.

I opened a PR with a deprecation on the "bundler 2" buildpack https://github.com/bundler/heroku-buildpack-bundler2/pull/7

obrmao commented 5 years ago

Just to add here, I've had the similar issue with Jekyll Netlify deploy. In Gemfile.lock I've changed:

BUNDLED WITH 
    2.0.1

to 1.17.1 and that made the deployment successful.

aloucas commented 5 years ago

On a dokku server with herokuish by using v199 heroku buildpack ruby:

dokku config:set --no-restart appname BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v199

With Gemfile.lock

[..]
rails (5.2.2)
      actioncable (= 5.2.2)
      actionmailer (= 5.2.2)
      actionpack (= 5.2.2)
      actionview (= 5.2.2)
      activejob (= 5.2.2)
      activemodel (= 5.2.2)
      activerecord (= 5.2.2)
      activestorage (= 5.2.2)
      activesupport (= 5.2.2)
      bundler (>= 1.3.0)
      railties (= 5.2.2)
      sprockets-rails (>= 2.0.0)
[..]
RUBY VERSION
   ruby 2.6.1p33

BUNDLED WITH
   2.0.1

deployment was successful

-----> Fetching custom buildpack
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.6.1
-----> Installing dependencies using bundler 2.0.1
[...]
=====> Application deployed:
[..]
brentgreeff commented 5 years ago

@brentgreeff are you using Ruby 2.6.0? If so, can you try with Ruby 2.6.1?

ruby 2.6.1p33

schneems commented 5 years ago

I found one case where invoking a command via a binstub fails with Bundler 2 and Ruby 2.6.1. I'm able to reproduce this on docker outside of Heroku and I've reported to Ruby core:

https://bugs.ruby-lang.org/issues/15622

I've detailed a few fixes on this thread: https://github.com/heroku/heroku-buildpack-ruby/issues/856#issuecomment-467205932

The easiest one is to make sure all your commands in your Procfile are prefixed with bundle exec which is annoying, but at least there's a viable workaround.

deivid-rodriguez commented 5 years ago

Yeah. Will be fixed in 2.6.2. Have a look at https://github.com/bundler/bundler/issues/6937 and https://bugs.ruby-lang.org/issues/15582. Best workaround for the moment, gem update --system to force the reinstallation of the default bundler gem.

zachaysan commented 5 years ago

I run a bunch of different servers. Here is roughly what worked for me:

In an emergency? bundle exec rake worked for me anywhere I tried it.

Want to fix the underlying problem?

  1. Update RVM, and be sure to add the new keys first, then rvm get head.
  2. Update to Ruby 2.6.1 if you need to.
  3. gem update --system
  4. gem list bundler to make sure you have Bundler 2

Now it should run without issue.

remidoolaeghe commented 5 years ago

I've encountered such problem on Heroku deployment that I've described in this stackoverflow post. The solution for me was setting in the Procfile the web command as follows:

web: bundle exec rails server -p $PORT -e $RAILS_ENV

Without it, Heroku was using the default Ruby 2.6.0 and then failing

schneems commented 5 years ago

Try Ruby 2.6.2 the 2.6.0 release has a bunch of bugs that were fixed.

quantumpotato commented 5 years ago
gem install bundler
Successfully installed bundler-2.0.1
Parsing documentation for bundler-2.0.1
Done installing documentation for bundler after 2 seconds
1 gem installed
~/project/rake routes
You must use Bundler 2 or greater with this lockfile.

?

quantumpotato commented 5 years ago
/usr/local/opt/ruby/bin/bundler version
Bundler version 2.0.1 (2019-01-04 commit d7ad2192f)
ruby --version
ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin17]
tegaete commented 5 years ago

A temp solution is uninstalling old versions of bundler.

gem uninstall bundler --version 1.17.2