0

I want to create my gemfile.lock file with bundler version 2.3.25

But when I try to bundle install it always is bundled with 2.4.5

So I uninstall bundler version 2.4.5 and it STILL bundles with that version, and then throws errors when I rails s because version 2.4.5 isn't there.

When I run gem list bundler right now I get: bundler (2.4.5, default: 2.3.25)

I've gone as far as to delete the file from

\\wsl$\Ubuntu\home\me\.rbenv\versions\2.7.0\lib\ruby\gems\2.7.0\gems\bundler-2.4.5

then, I delete the gemfile.lock file and bundle install and low and behold its bundled with 2.4.5..

I've tried gem uninstall bundler and no luck..

I've tried all of the following methods and no luck Here or Here

How can I either force Ruby to use the default version of Bundler, or REALLY get rid of the version I don't want?

ToddT
  • 3,084
  • 4
  • 39
  • 83
  • 3
    You can run `bundle __ ` to use a specific version e.g. `bundle _2.3.25_ install` that being said is there a specific reason you want to use an older bundler version? – engineersmnky Jan 27 '23 at 21:23
  • Thanks.. yes Heroku is throwing errors and I think that's why – ToddT Jan 27 '23 at 21:56

1 Answers1

0

Bundler will add its version number to Gemfile.lock after you've run bundle install:

BUNDLED WITH
   2.4.5

Therefore you can run bundle install with version 2.4.5 to generate Gemfile.lock and then edit it with a text editor to replace the version with the version you require. Then, when you run bundle install again bundler will notice that and will use the older version that you specify.

Gemfile.lock is a pretty straightforward and standard format and there are no material changes to it between those versions.

Otherwise, you can do like @engineersmnky said (and is explained in this other answer) and use:

bundle _2.3.25_ install
anothermh
  • 9,815
  • 3
  • 33
  • 52
  • Yea, something else must be wrong, because I've tried both those methods. And my lock file is STILL bundled with 2.4.5 weird – ToddT Jan 29 '23 at 19:31