language: ruby
sudo: false
rvm:
  - 2.3.3
services:
  - mongodb
before_script:
  - bundle exec rake db:mongoid:create_indexes

language: ruby
sudo: false
rvm:
  - 2.3.3
services:
  - mongodb

cache:
  directories:
    - "travis_phantomjs"

before_install:
  - export PHANTOMJS_VERSION=2.1.1
  - phantomjs --version
  - export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH
  - phantomjs --version
  - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi
  - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi
  - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi
  - phantomjs --version

before_script:
  - bundle exec rake db:mongoid:create_indexes

Use PhantomJS 2.1.1 (instead of 1.9.8)
Use PhantomJS 2.1.1 (instead of 1.9.8)

Ref: travis-ci/travis-ci#3225