flexbox / whatwentwrong

⚛ Documenting React Native most commons issues and solutions
0 stars 0 forks source link

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. #3

Open flexbox opened 5 years ago

flexbox commented 5 years ago

We have an error on the iOS build because CircleCI doesn't allow us to install the ruby bundler

cat: Gemfile.lock: No such file or directory
Fetching: bundler-2.0.1.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
Exited with code 1
flexbox commented 5 years ago

Solved with using sudo gem install bundler:

      - run:
          name: Set Ruby Version
          command: echo "ruby-2.6.3" > ~/.ruby-version
      - run:
          name: Configure Bundler
          command: |
            echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
            source $BASH_ENV
            sudo gem install bundler

Ressource: https://discuss.circleci.com/t/error-with-installing-bundler/18085/10