language: ruby
sudo: false
rvm:
  - 1.9.3
  - 2.0.0
  - 2.1.1
  - 2.2.0
  - 2.3.1
  - 2.4.1
  - jruby-1.7.27
  - jruby-9.1.13.0
env:
  matrix:
    - TASK=test
    - TASK=spec
    - TASK=rubocop
matrix:
  allow_failures:
    - rvm: jruby-1.7.27
    - rvm: jruby-9.1.13.0
before_install:
  - gem --version
script: bundle exec rake $TASK

language: ruby
sudo: false
rvm:
  - 1.9.3
  - 2.0.0
  - 2.1.1
  - 2.2.0
  - 2.3.1
  - 2.4.1
  - jruby-1.7.27
  - jruby-9.1.13.0
env:
  matrix:
    - TASK=test
    - TASK=spec
    - TASK=rubocop
matrix:
  allow_failures:
    - rvm: jruby-1.7.27
    - rvm: jruby-9.1.13.0
before_install:
  - gem --version
  - gem install bundler
script: bundle exec rake $TASK

Prepare newer Bundler in before_install
Travis: Prepare newer Bundler in before_install