I'm trying to get a legacy project working on my local machine.
- The project has a .ruby-version of
2.3.1
- I've confirmed that my shell has the rbenv bootstrap in it properly as in rbenv not changing ruby version
- I've tried variations of
rbenv rehash
andgem uninstall bundler
as in https://github.com/rubygems/bundler/issues/4260
My expectation is that the project will have Ruby 2.3.1 when I bundle install
however instead what's being used is the Mac OS X system Ruby 2.6.3.
$ rbenv global
2.3.1
$ rbenv local
2.3.1
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin19]
$ gem install bundler -v 1.17.3
Fetching: bundler-1.17.3.gem (100%)
Successfully installed bundler-1.17.3
Parsing documentation for bundler-1.17.3
Installing ri documentation for bundler-1.17.3
Done installing documentation for bundler after 4 seconds
1 gem installed
$ bundle install
Fetching gem metadata from https://rubygems.org/.......
google-protobuf-3.2.0.2-universal-darwin requires ruby version >= 2.0, < 2.5, which is incompatible with the current version, ruby 2.6.3p62
$ bundle env | grep Ruby
Ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Full Path /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Config Dir /Library/Ruby/Site
RubyGems 3.0.3
Gem Path /Users/charney/.gem/ruby/2.6.0:/Library/Ruby/Gems/2.6.0:/Users/charney/.gem:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
Checking for `rbenv' in PATH: /usr/local/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20210804)
Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: OK