
The issue where bundle install fails in Xcode Cloud with Xcode 27 beta 1 + macOS 26.4 has recurred.
This page has been translated by machine translation. View original
Previously, I introduced "the issue where bundle install fails in the Xcode Cloud environment with Xcode 16.4 + macOS 26.0."
I am currently maintaining an app that has not yet been able to move away from CocoaPods. After completing operation verification using Xcode 27.0 Beta (27A5194q) on my local PC, I tried building with the combination of Xcode 27.0 Beta + macOS 26.4 on Xcode Cloud, and bundle install failed. Investigation revealed that the same mechanism as before caused the problem to recur.
This article introduces the cause and how to address it.
Conclusion
With the combination of Xcode 27.0 Beta + macOS 26.4 on Xcode Cloud, bundle install fails. If you have Ruby 3.x installed and are using it on your local PC, this problem does not occur because it does not reference the system Ruby 2.6, but it does reproduce in environments that use the Xcode Cloud system Ruby 2.6.
When using Xcode 27.0 Beta, you need to either build in a macOS 27.0 Beta environment or, for the time being, continue with the combination of Xcode 26.4.1 + macOS 26.4.
Verification Environment
The following refers to the Xcode Cloud environment settings.
- Xcode 27.0 beta 1 (Build 27A5194q)
- macOS 26.4 (darwin25)
- System Ruby 2.6.10
[universal.arm64e-darwin25]
- System Ruby 2.6.10
Problem Details
When running bundle install using Xcode 27.0 Beta + macOS 26.4 on Xcode Cloud, the native extension compilation fails and CocoaPods cannot be installed.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
checking for whether -std=c99 is accepted as CFLAGS... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in
`try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
An error occurred while installing json (2.7.6), and Bundler cannot continue.
In Gemfile:
cocoapods was resolved to 1.16.2, which depends on
cocoapods-core was resolved to 1.16.2, which depends on
algoliasearch was resolved to 1.27.5, which depends on
json
Full error log
2026-06-21T23:45:34.399142196Z 🔎 Ruby executable: /usr/bin/ruby
2026-06-21T23:45:34.399601656Z 🔎 Ruby: ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin25]
2026-06-21T23:45:34.932166916Z 🔎 RubyGems: 3.0.3.1
2026-06-21T23:45:51.086345354Z ✅ Bundler installed
2026-06-21T23:45:51.086728543Z Your RubyGems version (3.0.3.1) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
2026-06-21T23:45:58.219854026Z Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
2026-06-21T23:45:58.220372385Z
2026-06-21T23:45:58.220815996Z current directory: /Users/local/.gem/gems/json-2.7.6/ext/json/ext/generator
2026-06-21T23:45:58.221005949Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
2026-06-21T23:45:58.221313266Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
2026-06-21T23:45:58.221476121Z ./siteconf20260621-2811-o4p2gn.rb extconf.rb
2026-06-21T23:45:58.221578936Z checking for whether -std=c99 is accepted as CFLAGS... *** extconf.rb failed ***
2026-06-21T23:45:58.221665585Z Could not create Makefile due to some reason, probably lack of necessary
2026-06-21T23:45:58.221754470Z libraries and/or headers. Check the mkmf.log file for more details. You may
2026-06-21T23:45:58.221957890Z need configuration options.
2026-06-21T23:45:58.222084079Z
2026-06-21T23:45:58.222396410Z Provided configuration options:
2026-06-21T23:45:58.222526098Z --with-opt-dir
2026-06-21T23:45:58.222621136Z --without-opt-dir
2026-06-21T23:45:58.222712602Z --with-opt-include
2026-06-21T23:45:58.222825925Z --without-opt-include=${opt-dir}/include
2026-06-21T23:45:58.222918799Z --with-opt-lib
2026-06-21T23:45:58.223029767Z --without-opt-lib=${opt-dir}/lib
2026-06-21T23:45:58.223116302Z --with-make-prog
2026-06-21T23:45:58.223204453Z --without-make-prog
2026-06-21T23:45:58.223319930Z --srcdir=.
2026-06-21T23:45:58.223439281Z --curdir
2026-06-21T23:45:58.223542311Z --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
2026-06-21T23:45:58.223674297Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in
2026-06-21T23:45:58.223766972Z `try_do': The compiler failed to generate an executable file. (RuntimeError)
2026-06-21T23:45:58.223852610Z You have to install development tools first.
2026-06-21T23:45:58.223956343Z from
2026-06-21T23:45:58.224111478Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in
2026-06-21T23:45:58.224264302Z `block in try_compile'
2026-06-21T23:45:58.224376931Z from
2026-06-21T23:45:58.224468196Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:532:in
2026-06-21T23:45:58.224627097Z `with_werror'
2026-06-21T23:45:58.224725563Z from
2026-06-21T23:45:58.224823680Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in
2026-06-21T23:45:58.225004235Z `try_compile'
2026-06-21T23:45:58.225123869Z from
2026-06-21T23:45:58.225361089Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:649:in
2026-06-21T23:45:58.225573916Z `try_cflags'
2026-06-21T23:45:58.225692731Z from
2026-06-21T23:45:58.225817539Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:655:in
2026-06-21T23:45:58.226145301Z `block (2 levels) in append_cflags'
2026-06-21T23:45:58.226422119Z from
2026-06-21T23:45:58.226635796Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in
2026-06-21T23:45:58.226807336Z `block in checking_for'
2026-06-21T23:45:58.226925652Z from
2026-06-21T23:45:58.227168052Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in
2026-06-21T23:45:58.227331215Z `block (2 levels) in postpone'
2026-06-21T23:45:58.230151479Z from
2026-06-21T23:45:58.230484324Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in
2026-06-21T23:45:58.230596559Z `open'
2026-06-21T23:45:58.230823930Z from
2026-06-21T23:45:58.230934729Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in
2026-06-21T23:45:58.231143056Z `block in postpone'
2026-06-21T23:45:58.231287405Z from
2026-06-21T23:45:58.231396058Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in
2026-06-21T23:45:58.231523626Z `open'
2026-06-21T23:45:58.231666859Z from
2026-06-21T23:45:58.231797918Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in
2026-06-21T23:45:58.232067297Z `postpone'
2026-06-21T23:45:58.232596880Z from
2026-06-21T23:45:58.232800392Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in
2026-06-21T23:45:58.232984564Z `checking_for'
2026-06-21T23:45:58.233124462Z from
2026-06-21T23:45:58.233277432Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:649:in
2026-06-21T23:45:58.233445432Z `try_cflags'
2026-06-21T23:45:58.233583835Z from
2026-06-21T23:45:58.233709471Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:654:in
2026-06-21T23:45:58.233841669Z `block in append_cflags'
2026-06-21T23:45:58.233943961Z from
2026-06-21T23:45:58.234098078Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:653:in
2026-06-21T23:45:58.234355046Z `each'
2026-06-21T23:45:58.234521662Z from
2026-06-21T23:45:58.234098078Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:653:in
2026-06-21T23:45:58.234355046Z `append_cflags'
2026-06-21T23:45:58.234521662Z from extconf.rb:7:in `<main>'
2026-06-21T23:45:58.235091082Z
2026-06-21T23:45:58.235682925Z To see why this extension failed to compile, please check the mkmf.log which can
2026-06-21T23:45:58.236355975Z be found here:
2026-06-21T23:45:58.237348520Z
2026-06-21T23:45:58.237561033Z /Users/local/.gem/extensions/universal-darwin-25/2.6.0/json-2.7.6/mkmf.log
2026-06-21T23:45:58.237696799Z
2026-06-21T23:45:58.237844304Z extconf failed, exit code 1
2026-06-21T23:45:58.237940435Z
2026-06-21T23:45:58.238081705Z Gem files will remain installed in /Users/local/.gem/gems/json-2.7.6 for
2026-06-21T23:45:58.238205455Z inspection.
2026-06-21T23:45:58.238339972Z Results logged to
2026-06-21T23:45:58.238416153Z /Users/local/.gem/extensions/universal-darwin-25/2.6.0/json-2.7.6/gem_make.out
2026-06-21T23:45:58.238486138Z
2026-06-21T23:45:58.238645725Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:99:in
2026-06-21T23:45:58.238776513Z `run'
2026-06-21T23:45:58.238885344Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/ext_conf_builder.rb:47:in
2026-06-21T23:45:58.239577023Z `block in build'
2026-06-21T23:45:58.239738813Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tempfile.rb:295:in
2026-06-21T23:45:58.240301587Z `open'
2026-06-21T23:45:58.240479166Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/ext_conf_builder.rb:29:in
2026-06-21T23:45:58.240617028Z `build'
2026-06-21T23:45:58.240771697Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:185:in
2026-06-21T23:45:58.240934642Z `block in build_extension'
2026-06-21T23:45:58.241142510Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/monitor.rb:235:in
2026-06-21T23:45:58.241272068Z `mon_synchronize'
2026-06-21T23:45:58.241456456Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:181:in
2026-06-21T23:45:58.241735821Z `build_extension'
2026-06-21T23:45:58.241844233Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:229:in
2026-06-21T23:45:58.242097182Z `block in build_extensions'
2026-06-21T23:45:58.242209848Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:226:in
2026-06-21T23:45:58.242888230Z `each'
2026-06-21T23:45:58.243058223Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:226:in
2026-06-21T23:45:58.243208417Z `build_extensions'
2026-06-21T23:45:58.243317447Z /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/installer.rb:830:in
2026-06-21T23:45:58.243474459Z `build_extensions'
2026-06-21T23:45:58.243571008Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/rubygems_gem_installer.rb:76:in
2026-06-21T23:45:58.243933461Z `build_extensions'
2026-06-21T23:45:58.244113825Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/rubygems_gem_installer.rb:28:in
2026-06-21T23:45:58.244380657Z `install'
2026-06-21T23:45:58.244670910Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/source/rubygems.rb:203:in
2026-06-21T23:45:58.244876078Z `install'
2026-06-21T23:45:58.245134172Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/installer/gem_installer.rb:54:in
2026-06-21T23:45:58.245282860Z `install'
2026-06-21T23:45:58.245424604Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/installer/gem_installer.rb:16:in
2026-06-21T23:45:58.245571378Z `install_from_spec'
2026-06-21T23:45:58.245670288Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/installer/parallel_installer.rb:130:in
2026-06-21T23:45:58.245897320Z `do_install'
2026-06-21T23:45:58.246107435Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/installer/parallel_installer.rb:121:in
2026-06-21T23:45:58.246277107Z `block in worker_pool'
2026-06-21T23:45:58.246377142Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/worker.rb:62:in `apply_func'
2026-06-21T23:45:58.246491318Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/worker.rb:57:in `block in
2026-06-21T23:45:58.246597254Z process_queue'
2026-06-21T23:45:58.246780049Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/worker.rb:54:in `loop'
2026-06-21T23:45:58.247508319Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/worker.rb:54:in
2026-06-21T23:45:58.247747293Z `process_queue'
2026-06-21T23:45:58.248091527Z /Users/local/.gem/gems/bundler-2.4.22/lib/bundler/worker.rb:90:in `block (2
2026-06-21T23:45:58.248210729Z levels) in create_threads'
2026-06-21T23:45:58.248367334Z
2026-06-21T23:45:58.248461198Z An error occurred while installing json (2.7.6), and Bundler cannot continue.
2026-06-21T23:45:58.248546286Z
2026-06-21T23:45:58.248806161Z In Gemfile:
2026-06-21T23:45:58.249005186Z cocoapods was resolved to 1.16.2, which depends on
2026-06-21T23:45:58.249273596Z cocoapods-core was resolved to 1.16.2, which depends on
2026-06-21T23:45:58.249527227Z algoliasearch was resolved to 1.27.5, which depends on
2026-06-21T23:45:58.249671238Z json
Root Cause Analysis
System Ruby 2.6 references the Ruby headers within the macOS SDK of the currently active Xcode when building native extensions. Comparing the directory structure of Ruby headers within the SDK makes this easier to understand.
# MacOSX26.0.sdk in Xcode 26.4.1
.../ruby-2.6.0/
└── universal-darwin25/ ← for macOS 26.x (darwin25) ✅
# MacOSX27.0.sdk in Xcode 27 beta 1
.../ruby-2.6.0/
└── universal-darwin26/ ← only for macOS 27.x (darwin26) ❌
Since macOS 26.4 has a darwin25 kernel, the system Ruby looks for universal-darwin25/ruby/config.h. However, Xcode 27's MacOSX27.0.sdk only contains universal-darwin26 and not universal-darwin25, causing the build to fail.
This is a problem that occurs when the major version of Xcode and the major version of macOS do not match, and it has exactly the same structure as the previous article.
Build Results by Combination
| Combination | Expected SDK | Darwin Version | Build Result |
|---|---|---|---|
| Xcode 26.4.1 + macOS 26.4 | MacOSX26.0.sdk | darwin25 | ✅ Success |
| Xcode 27.0 Beta + macOS 26.4 | MacOSX27.0.sdk | darwin25 | ❌ Failure |
| Xcode 27.0 Beta + macOS 27.0 Beta | MacOSX27.0.sdk | darwin26 | ✅ Success |
Solution
At this point, it would be best to use one of the following combinations.
- Xcode 26.4.1 + macOS 26.4 (when continuing to use the existing environment)
- Xcode 27.0 Beta + macOS 27.0 Beta (when migrating to the latest environment)
Long-term Solution: Migration to SPM
As mentioned in the previous article, the root cause of this problem is that CocoaPods has a system dependency on Ruby. By migrating to Swift Package Manager (SPM), the dependency on the Ruby environment can be eliminated, preventing this type of problem from occurring.
The CocoaPods Specs repository is scheduled to become read-only on December 2, 2026, and migration to SPM is inevitable from a long-term perspective.
Summary
In the Xcode Cloud environment with Xcode 27.0 Beta + macOS 26.4, bundle install fails because MacOSX27.0.sdk does not include Ruby 2.6 headers for darwin25. The problem does not occur if the major versions of Xcode and macOS match.
When migrating to Xcode 27.0 Beta, the practical approach is to either build in a macOS 27.0 Beta environment or continue with the combination of Xcode 26.4.1 + macOS 26.4 for the time being. Migration to SPM is desirable as a fundamental solution, and I hope this will be helpful for those who continue to use CocoaPods.
Job Openings: Classmethod is hiring iOS engineers
The Starbucks Digital Technology Division is looking for engineers capable of iOS app development. We are looking forward to applications from those who would like to work with us, sharing information about new Xcode and iOS features through misc-ios and other channels!
We are also hiring iOS/Android engineers in other areas. Let's talk about mobile app development together!