CircleCI 2.0 iOS - Error installing Gems

Hi folks,

We’re in the process of migrating our iOS build from CircleCI 1.0 to 2.0 and are running into a problem with installing gems.

When we try to run bundle install we get the following output:

Fetching source index from
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from
Could not fetch specs from
Exited with code 17

Our Gemfile is as follows:

source ""

gem 'fastlane', '2.93.1'
gem 'cocoapods'
gem 'cocoapods-bugsnag'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

Our circle-ci config is as follows:

      xcode: "9.0"

    parallelism: 1

    working_directory: ~/[ REDACTED ]/apps

      BUNDLE_PATH: ./ios/vendor/bundle

      - checkout

      - restore_cache:
            - v1-dep-{{ .Branch }}-
            - v1-dep-master-
            - v1-dep-

      - run: brew update

      - run: brew install imagemagick

      - run:
          name: Install Gems
          working_directory: ./ios
          command: |
            bundle check || bundle install --path vendor/bundle

      - run:
          name: Install CocoaPods
          working_directory: ./ios
          command: |
            curl | bash -s cf
            pod install

      - save_cache:
          key: v1-dep-{{ .Branch }}-{{ epoch }}
            - ./node_modules
            - ./ios/Pods
            - ./ios/vendor/bundle

      - run:
          working_directory: ./ios
          command: |
            bundle exec fastlane systest

Any help would be much appreciated! :slight_smile:


I’m having the exact same issue. Bundle install is failing, seemingly unrelated to the contents of our gemfile.

Any help would be appreciated!

After some experimentation, i had to change the https at the top of my gemfile to http. This technically works, but I don’t like the fact that I have to use bundle over insecure HTTP! I hope this gets fixed soon

I experienced same error.
It turns out that the “RubyGems and Bundler TLS/SSL Issues”

As a result, will require TLSv1.2 at minimum starting January 2018. This means and the gem command will no longer support versions of Ruby and OpenSSL that are do not have support of TLS 1.2.

For CircleCI 2.0 macos vm, we can change ruby version from system to another using chruby.

See for a solution

1 Like

Thanks @hiroshi. It was fixed using:

  - checkout

  # Install CocoaPods
  - run:
      name: Install CocoaPods
      command: pod install

  # Set Ruby version
  - run:
      name: Set Ruby Version
      command:  echo "ruby-2.4" > ~/.ruby-version
  # Install bundles
  - run: bundle install
  # Build the app and run tests
  - run:
      name: Build and run tests
      command: bundle exec fastlane $FASTLANE_LANE
1 Like

Installing CocoaPods takes a lot of time. Isn’t there another way to solve this?

Continuing the discussion from CircleCI 2.0 iOS - Error installing Gems:

Ruby 2.4 should be the default for iOS projects. The current default just doesn’t work because you’ll get
ssl errors trying to install from And this is nowhere mentioned in the docs.

I’m still having this issue, and the ~/.ruby-version workaround is not working for me. I’m curious if anyone has a working solution.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.