dist: trusty
sudo: required
language: ruby
rvm: 2.6.5
bundler_args: --without development production

env:
  - ELASTICSEARCH_URL=http://localhost:9250 ES_VERSION=2.4.5 ES_DOWNLOAD_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz  TEST_CLUSTER_COMMAND=/tmp/elasticsearch-${ES_VERSION}/bin/elasticsearch RAILS_ENV=test

before_install:
  - gem update --system
  - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
  - gem install bundler -v 2.0.2
  - curl -sS https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz | tar xz -C /tmp

services:
  - postgresql

before_script:
  - cp config/database.yml.travis config/database.yml
  - psql -c 'create database travis_test;' -U postgres
  - bundle exec rake db:migrate
  - export RECAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
  - export RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
  - sleep 10
script:
  - bundle exec rspec spec/

dist: trusty
sudo: required
language: ruby
rvm: 2.6.5
bundler_args: --without development production

env:
  - ELASTICSEARCH_URL=http://localhost:9250 ES_VERSION=2.4.5 ES_DOWNLOAD_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz  TEST_CLUSTER_COMMAND=/tmp/elasticsearch-${ES_VERSION}/bin/elasticsearch RAILS_ENV=test

before_install:
  - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
  - gem install bundler -v 2.0.2
  - curl -sS https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz | tar xz -C /tmp

services:
  - postgresql

before_script:
  - cp config/database.yml.travis config/database.yml
  - psql -c 'create database travis_test;' -U postgres
  - bundle exec rake db:migrate
  - export RECAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
  - export RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
  - sleep 10
script:
  - bundle exec rspec spec/

Remove gem update system which runs into errors
Remove gem update system which runs into errors

concerning bundler version
