Hi everyone,
I have a simple issue when trying to restore a cache of my Gemfiles.
I am using the circleci/ruby-2.3 docker image as the base.
When I run rebuild without cache it always works.
Here is the error:
tar: root/bearcloud-api/vendor/bundle: Cannot mkdir: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby: Cannot mkdir: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0: Cannot mkdir: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin: Cannot mkdir: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/_guard-core: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/byebug: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/cap: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/capify: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/coderay: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/console: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/fission: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/fog: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/guard: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/htmldiff: Cannot open: Permission denied tar: root/bearcloud-api/vendor/bundle/ruby/2.3.0/bin/ldiff: Cannot open: Permission denied ...
Here is my config.yml:
``
jobs:
build:
working_directory: ~/bearcloud-api
environment:
- RAILS_ENV: “test”
docker:
  - image: circleci/ruby:2.3
  - image: timescale/timescaledb:latest
    command: [-cshared_preload_libraries=timescaledb]
  - image: bitnami/memcached:latest
steps:
  - checkout
  - run:
      name: Update bundler
      command: 'gem install bundler'
  - restore_cache:
      key: dependency-cache-{{ checksum "Gemfile" }}
  - run:
      name: Installing dependencies
      command: bundle install --path vendor/bundle
  - save_cache:
      key: dependency-cache-{{ checksum "Gemfile" }}
      paths:
        - vendor/bundle
  - run:
      name: Linking database configuration
      command: cp config/database.yml.ci config/database.yml
  - run:
      name: Setup database
      command: bin/rails db:setup
  - run:
      name: Prepare tests
      command: mkdir -p /tmp/reports
  - run:
      name: Run rspec
      command: bin/rspec  --format progress --format RspecJunitFormatter -o /tmp/reports/rspec.xml
  - store_test_results:
      path: /tmp/reports
  - deploy:
      command: |
        if [ "${CIRCLE_BRANCH}" == "develop" ];
          then cap staging deploy;
        fi
  - deploy:
      command: |
        if [ "${CIRCLE_BRANCH}" == "master" ];
          then cap staging production;
        fi
``
