Install older versions of rubygems and bundler only on Ruby < 2.7

This commit is contained in:
Akira Matsuda 2019-12-27 19:51:59 +09:00
parent 4fa30f5bfc
commit 37e1fe5a68
1 changed files with 4 additions and 3 deletions

View File

@ -100,7 +100,8 @@ matrix:
gemfile: test/gemfiles/Gemfile.rails-5.0.x.erubi
fast_finish: true
before_install:
- gem i rubygems-update -v '<3' && update_rubygems # https://github.com/travis-ci/travis-ci/issues/8974
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
- gem i bundler -v '<2'
# install older versions of rubygems and bundler only on Ruby < 2.7
- if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem i rubygems-update -v '<3' && update_rubygems; fi; # https://github.com/travis-ci/travis-ci/issues/8974
- if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true; fi;
- if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem i bundler -v '<2'; fi;
script: "bundle exec rake submodules test"