Travis-CI 配置文件自定义

Travis-CI config file customization

在我当前的 travis-ci 文件中我有这个配置。

注意:我想自定义此文件,因为 vendor/cache 中没有任何内容。由于在 travis-ci build

上出现错误
0.44s$ bundle install --local
Some gems seem to be missing from your vendor/cache directory.
Could not find rake-10.5.0 in any of the sources
The command "bundle install --local" failed and exited with 7 during .
Your build has been stopped.

我只想消除这个错误,但我完全不熟悉 Travis-ci。我也不想在 vendor/cache 中放置任何宝石,因为它会使 repo 的大小变得更大。有什么帮助吗?

language: ruby
install: bundle install --local
cache:
  apt: true
  bundler: true
  directories:
  - vendor/cache

rvm:
- 2.2.2

addons:
  postgresql: 9.3
  code_climate:
      repo_token: 

before_script:
  - psql -U postgres -c "create extension postgis"
  - ./scripts/travis
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - sleep 1

script:
- RAILS_ENV=test bundle exec rspec --pattern 'c*/*_spec.rb,h*/*_spec.rb'

env:
  matrix:
  - DATABASE_URL="postgres://localhost/evercam_tst"
  global:
  - secure: 
  - secure: 

branches:
  only: master

通过删除该行

install: bundle install --local

并放置 cache: bundler 并删除那些有效的行!

  apt: true
  bundler: true
  directories:
  - vendor/cache