title: How to use cache for a rails project in Gitlab CI?
body: <p>I've been trying to leverage Gitlab Ci's cache for my ruby on rails application but so far haven't had any luck, my application is using shared runners, maybe that's the issue?</p>
  
  <p>Here are the contents of my <code>.gitlab-ci.yml</code></p>
  
  <pre><code>services:
    - postgres:latest
  
  rspec:
    stage: test
    script:
      - apt-get update -qy
      - apt-get install -y nodejs
      - gem install bundler
      - bundle check --path vendor/bundle || bundle install --path vendor/bundle --jobs $(nproc)
      - cp config/database.gitlab-ci.yml config/database.yml
      - RAILS_ENV=test bundle exec rake db:create db:schema:load
      - bundle exec rspec
    cache:
      paths:
        - vendor/bundle
    tags:
      - ruby
      - postgres
  </code></pre>
  
  <p>When my tests run I do see the runner checking for cached content, but it never restores it:</p>
  
  <pre><code>gitlab-ci-multi-runner 1.1.3 (a470667)
  Using Docker executor with image ruby:2.1 ...
  Pulling docker image postgres:latest ...
  Starting service postgres:latest ...
  Waiting for services to be up and running...
  Pulling docker image ruby:2.1 ...
  
  Running on runner-8a2f473d-project-1129003-concurrent-0 via runner-8a2f473d-machine-1462982763-a9a70bd7-digital-ocean-4gb...
  Cloning repository...
  Cloning into '/builds/foo/bar'...
  Checking out 30ea1b5f as master...
  Note: checking out '30ea1b5f036808f7e27bfa32e939c1f591343ba6'.
  
  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by performing another checkout.
  
  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -b with the checkout command again. Example:
  
    git checkout -b &lt;new-branch-name&gt;
  
  HEAD is now at 30ea1b5... Fix width of tables contained in table-scroll divs
  Checking cache for rspec/master...
  
  $ apt-get update -qy
  </code></pre>
  
  <p>And when the build is about to finish I do see it trying to create the cache:</p>
  
  <pre><code>Creating cache rspec/master...
  vendor/bundle: found 8917 matching files
  </code></pre>
  
  <p>Any ideas?   </p>