Permission denied error in Pipeline

I try to use Gitlab CI for my iOS project.

My Gitlab Pipeline starts after committing a new git (so far so good).

But after a few seconds, the Pipeline throws the following error:

    Running with gitlab-runner 11.9.0 (692ae235)
      on MyApp runner with shell DsaBC-oQ
    Using Shell executor...
    Running on
    mkdir: /Users/myusername/builds/DsaBC-oQ/0/username/myproj.tmp: Permission denied
    mkdir: /Users/myusername/builds/DsaBC-oQ/0/username/myproj.tmp: Permission denied
    ERROR: Job failed: exit status 1

I did the following steps:

  1. register gitlab-runner with the following cmd:
    gitlab-runner register \
      --non-interactive \
      --url "" \
      --registration-token "TOKENABCDEF" \
      --description "MyApp runner with shell" \
      --tag-list ios \
      --executor "shell"
  1. start the runner:
    gitlab-runner install
    gitlab-runner start

Can you please explain how to get rid of this “permission denied” error in my Pipeline ? (I am on MacOS trying to CI an iOS project).

It turned out that the “permission denied” error on my GitLab Pipeline had nothing to do with GitLab itself - but was due to a Ruby version mismatch on my Mac that I connected with the gitlab-runner.

I was able to update my Ruby version with the help of this post (i.e. using chruby). There are other possibilities out there on how to update Ruby on your Mac. It is important to understand that GitLab requires your Mac to have a stable Ruby environment.

As a side-note: Here is the best tutorial on how to set up GitLab CI for an iOS-project that I have found.