3

Very new to Ruby and Ruby on Rails, so apologies in advance. I've found many similar posts to this, but the suggestions haven't worked for me so far.

I get that the Bundler version I'm using doesn't match with the of Heroku when I try to deploy, but can't get them to match.

I tried this and it looked like it would work, but no luck. You must use Bundler 2 or greater with this lockfile

Does anyone have any ideas, or can you tell me what information you require to give some assistance?

Many thanks!

revlis
  • 175
  • 2
  • 11

3 Answers3

4
  1. Remove your Gemfile.lock

  2. Install old version of bundler, for example

gem install bundler -v 1.17.3
  1. Run this bundler in your project directory
bundle _1.17.3_ install
  1. Make any commit, for example
git commit -am "Bundler 1.17.3 was installed"
  1. Run
git push heroku master
  1. Smile
mechnicov
  • 12,025
  • 4
  • 33
  • 56
1

I had this issue as well trying to push to my Heroku project. Found the answer in another question and it worked for me: You must use Bundler 2 or greater with this lockfile

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

Then try push your app again.

1

I struggled with this and after seeing another comment, I realized that when I upgraded the latest version of Ruby that it was not compatible with Bundler. I uninstalled Ruby, installed Ruby 2.4.5-1 and reinstalled my gems (including Rails). I can now get on Rails and no more Bundler error.