I’d try manually this part of the install script:
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install "2.7.1"
rbenv global "2.7.1"
rbenv rehash
gem update --system
gem install rails
gem install bundler
and then bundle install