language: ruby
sudo: false
services:
  - mysql
rvm:
  - 2.5.8
  - 2.6.6
  - 2.7.1
gemfile:
  - gemfiles/rails_4.2.gemfile
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
  - gemfiles/rails_5.2.gemfile
  - gemfiles/rails_6.0.gemfile
before_install:
  - "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true"
  - "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && gem install bundler -v '< 2' || true"
before_script:
  - RAILS_ENV=test bundle exec rake db:setup

language: ruby
sudo: false
services:
  - mysql
rvm:
  - 2.5.8
  - 2.6.6
  - 2.7.1
gemfile:
  - gemfiles/rails_4.2.gemfile
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
  - gemfiles/rails_5.2.gemfile
  - gemfiles/rails_6.0.gemfile
before_install:
  - "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true"
  - "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && gem install bundler -v '< 2' || true"
  - "[[ $BUNDLE_GEMFILE =~ rails_4\\.2 ]] && export BUNDLER_VERSION=1.17.3 || true"
before_script:
  - RAILS_ENV=test bundle exec rake db:setup

Use bundler v1.17.3 in rails 4.2
Use bundler v1.17.3 in rails 4.2
