Gitlab-runner failing if there is Gemfile in the directory

Similar issues

#3499 (closed)

#1784 (closed)

Gitlab-runner failing if there is Gemfile in the directory. This problem gets fixed when i remove from directory the file. but this file needs to be exist in the project

Running with gitlab-runner 12.1.0 (de7731dd)

   on Mac-Mini f96_aywm
Using Shell executor...
00:00
Running on siab01ios.siab01.com...
00:01
Fetching changes...
00:03
 Initialized empty Git repository in /Users/gitlabrunner/builds/f96_aywm/0/reactnative/xxxx/.git/
 Created fresh repository.
 From https://gitlab.xxxx.com/reactnative/xxxx
  * [new ref]         refs/pipelines/5138   -> refs/pipelines/5138
  * [new branch]      bugfix                -> origin/x
  * [new branch]      develop               -> origin/develop
  * [new branch]      feature/xxxxx-server  -> origin/feature/x-x
  * [new branch]      feature/xxxxxxxxxx    -> origin/feature/x
  * [new branch]      feature/xxxxxxxxxxxxx -> origin/feature/x
  * [new branch]      feature/xxxxxxxxx     -> origin/feature/x
  * [new branch]      master                -> origin/master
  * [new tag]         2.0                   -> 2.0
  * [new tag]         android/2.1.0         -> android/2.1.0
  * [new tag]         android/2.1.1         -> android/2.1.1
 Checking out cd81e8c9 as feature/xxx...
 Skipping Git submodules setup
 ERROR: Job failed: exit status 1

what i tried

  • I renamed Gemfile to Gemfile_fix and added following variable to .gitlab-ci.yml
variables:

BUNDLE_GEMFILE: "Gemfile_fix"
  • As another solution i tried I created a folder named gemfile_fix and I added Gemfile into this file, again I added the following variable to the gitlab-ci.yml file
variables:

BUNDLE_GEMFILE: Dir.chdir File.expand_path('gemfile_fix/Gemfile', __FILE__)