set -v

echo "gem: --no-ri --no-rdoc --no-document" > ~/.gemrc
travis_retry gem install bundler -v "~> 1.10.6"

if [[ -n "${GEM}" ]] ; then
  cd gems/${GEM}
else
  [[ -z "${SPA_UI}" ]] || nvm install 0.12

  echo "1" > REGION
  cp certs/v2_key.dev certs/v2_key
  cp config/database.pg.yml config/database.yml
  psql -c "CREATE USER root SUPERUSER PASSWORD 'smartvm';" -U postgres
  export BUNDLE_WITHOUT=development
fi
export BUNDLE_GEMFILE=${PWD}/Gemfile

set +v

set -v

echo "gem: --no-ri --no-rdoc --no-document" > ~/.gemrc
travis_retry gem install bundler -v ">= 1.11.1"

if [[ -n "${GEM}" ]] ; then
  cd gems/${GEM}
else
  [[ -z "${SPA_UI}" ]] || nvm install 0.12

  echo "1" > REGION
  cp certs/v2_key.dev certs/v2_key
  cp config/database.pg.yml config/database.yml
  psql -c "CREATE USER root SUPERUSER PASSWORD 'smartvm';" -U postgres
  export BUNDLE_WITHOUT=development
fi
export BUNDLE_GEMFILE=${PWD}/Gemfile

set +v

Allow newer bundler since 1.11.1 is released with a bug fix.
Allow newer bundler since 1.11.1 is released with a bug fix.

a3371736aa197a840f5e4a837f78b6945ef59b6a prevented 1.11.0 due to a bug,
see Bundler 4149.

1.11.1 is now released with a fix so let's unleash the latest bundler
so travis helps us keep bundler current.
