I am trying to update ruby version from 2.7.5 to 3.1.1 but after changing .ruby-version and running docker-compose build I am seeing following error during build
#34 2.552 >> Bundling for a production/staging environment
#34 4.943 Bundler 2.3.10 is running, but your lockfile was generated with 2.1.4. Installing Bundler 2.1.4 and restarting using that version.
#34 66.70 Fetching gem metadata from https://rubygems.org/.
#34 67.14 Fetching bundler 2.1.4
#34 68.59 Installing bundler 2.1.4
#34 70.09 Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
#34 73.84 Fetching gem metadata from https://rubygems.org/.........
#34 80.77 Fetching gem metadata from https://rubygems.org/.
#34 80.94 Resolving dependencies......
#34 81.77 async-io-1.27.7 requires ruby version ~> 2.4, which is incompatible with the
#34 81.77 current version, ruby 3.1.1p18
After searching for this error online it says the solution is to run
bundle _2.3.10_ update --bundler
I have bunch of questions. How can I run this command since I run everything in docker container? Also would this change be temporary as currently the bundler version in gemfile.lock is 2.1.4 and how can I update that so I dont see the error again if I remove containers and run project again?