Error installing gemfile with fastlane on CircleCI

I have the following gemfile:

source ""

gem "cocoapods", "=1.5.3"
gem "cocoapods-check", "=1.1.0"
gem "fastlane", "~> 2.131"

And the following section of pipeline on CircleCI:

- run:
          name: Install Gemfile for Fastlane
          command: bundle check || bundle install --path vendor/bundle

This then produces this output:

#!/bin/bash --login -o pipefail
bundle check || bundle install --path vendor/bundle
^D^DThe following gems are missing
 * minitest (5.12.0)
 * babosa (1.0.3)
 * cocoapods-core (1.5.3)
 * fourflusher (2.0.1)
 * cocoapods (1.5.3)
 * cocoapods-check (1.1.0)
 * excon (0.67.0)
 * json (2.2.0)
 * rubyzip (1.3.0)
Install missing gems with `bundle install`
Fetching gem metadata from
Using CFPropertyList 3.0.1
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using minitest 5.12.0
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport
Fetching public_suffix 2.0.5
Installing public_suffix 2.0.5
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using atomos 0.1.3
Fetching babosa 1.0.3
Installing babosa 1.0.3
Using bundler 2.0.2
Using claide 1.0.3
Using fuzzy_match 2.0.4
Using nap 1.1.0
Using cocoapods-core 1.5.3
Using cocoapods-deintegrate 1.0.4
Using cocoapods-downloader 1.2.2
Using cocoapods-plugins 1.0.0
Using cocoapods-search 1.0.0
Using cocoapods-stats 1.1.0
Using netrc 0.11.0
Using cocoapods-trunk 1.4.0
Using cocoapods-try 1.1.0
Using colored2 3.1.2
Using escape 0.0.4
Using fourflusher 2.0.1
Using gh_inspector 1.1.3
Using molinillo 0.6.6
Using ruby-macho 1.4.0
Using nanaimo 0.2.6
Using xcodeproj 1.12.0
Using cocoapods 1.5.3
Using cocoapods-check 1.1.0
Fetching colored 1.2
Installing colored 1.2
Fetching highline 1.7.10
Installing highline 1.7.10
Fetching commander-fastlane 4.4.6
Installing commander-fastlane 4.4.6
Fetching declarative 0.0.10
Installing declarative 0.0.10
Fetching declarative-option 0.1.0
Installing declarative-option 0.1.0
Fetching digest-crc 0.4.1
Installing digest-crc 0.4.1
Fetching unf_ext
Installing unf_ext with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20190926-723-dvbzjp.rb extconf.rb
mkmf.rb can't find header files for ruby at

extconf failed, exit code 1

Gem files will remain installed in
/Users/distiller/project/vendor/bundle/ruby/2.3.0/gems/unf_ext- for
Results logged to

An error occurred while installing unf_ext (, and Bundler
cannot continue.
Make sure that `gem install unf_ext -v '' --source
''` succeeds before bundling.

In Gemfile:
  fastlane was resolved to 2.131.0, which depends on
    faraday-cookie_jar was resolved to 0.0.6, which depends on
      http-cookie was resolved to 1.0.3, which depends on
        domain_name was resolved to 0.5.20190701, which depends on
          unf was resolved to 0.1.4, which depends on
Exited with code 5
CircleCI received exit code 5

As you can see, it seems to fail when installing unf_ext. Why is this? It looks like there’s something wrong with Ruby? Isn’t the latest version 2.4? Why is it using 2.3? How can I solve this?

Hi yusuf,

What version of Xcode are you using? I’m guessing 11 due to the error message and some recent change we’ve made to address this issue.

2.3 is the version or Ruby that comes bundled with macOS Mojave, that we use for all images after Xcode 9.0 (I think?).

Hi marc,

Thanks for the reply. Yes that’s right it’s Xcode 11. Is there a way to resolve this issue?

Oh hold on, it seems to work now. This error was actually produced yesterday but now I just tested it and it’s all fine. Thanks for your work!

Oh brilliant. I was confused - I pushed the fix about 18:00 GMT yesterday, so I’m glad it’s resolved.