3
$ gem list bundler                                                                                                      

*** LOCAL GEMS ***

bundler (default: 1.17.3)
capistrano-bundler (2.0.1)
$ ruby --version                                                                                                        
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
$ bundle _1.17.3_ -v                                                                                                    
Bundler version 2.1.4

Why does Bundler claim to be 2.1.4, when I don't have that installed?

Is this a way of trying to force me to upgrade by making my Gemfile think I used a newer version, and then making me install that to continue?

Or is there some configuration that I'm overlooking?

UPDATE

gem list bundle -d returns

*** LOCAL GEMS ***

bundler (1.17.3)
    Authors: André Arko, Samuel Giddins, Colby Swandale, Hiroshi
    Shibata, David Rodríguez, Grey Baker, Stephanie Morillo, Chris
    Morris, James Wen, Tim Moore, André Medeiros, Jessica Lynn Suttles,
    Terence Lee, Carl Lerche, Yehuda Katz
    Homepage: http://bundler.io
    License: MIT
    Installed at (default): /Users/brandon/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0

    The best way to manage your application's dependencies

capistrano-bundler (2.0.1)
    Authors: Tom Clements, Lee Hambley, Kir Shatrov
    Homepage: https://github.com/capistrano/bundler
    License: MIT
    Installed at: /Users/brandon/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0

    Bundler support for Capistrano 3.x

which bundle returns

/Users/brandon/.rbenv/shims/bundle

Running eval "$(rbenv init -)" does not change anything.

Updating above 2.1.4 doesn't fix the problem either. No matter what I install, I'm told I'm using 2.1.4:

$ gem install --default bundler:2.2.24
Successfully installed bundler-2.2.24 as a default gem
WARNING:  Unable to pull data from 'https://gems.github.com/': bad response Not Found 404 (https://gems.github.com/specs.4.8.gz)
1 gem installed
$ bundler --version
Bundler version 2.1.4
iconoclast
  • 21,213
  • 15
  • 102
  • 138
  • Maybe run `which bundle` and see where it points? If you use `rbenv` it might be that you need to rehash your shims (`eval "$(rbenv init -)"`) if you recently updated rbenv. – rmlockerd Jul 22 '21 at 01:39
  • Your `$PATH` may be inconsistent so that your `bundle` executable is from a different Ruby installation (with different gems) than your `ruby` and `gem` executables. This may be cuased when mixing a system-installed Ruby with a half-installed version manager such as rbenv or rvm. – Holger Just Jul 22 '21 at 12:20

2 Answers2

0

You probably have couple versions installed, try

gem list bundle -d

to see where those are installed

which bundle

to see where 2.1.4 resides

LE-HU
  • 631
  • 5
  • 17
0

If you are working in a shared environment, may be the root user would have the bundler which is showing bundle -v as 2.1.4

to find it, you can try digging it in your environment by env command which will give your environment variables list:

$ env
$ echo $PATH

and your bundler list which you are seeing on gem list bundler would be from your local user space

you can refer these too, which would probably hit the solution

How to `bundle install` when your Gemfile requires an older version of bundler?

How to bundle install gemfile with specific version of bundler