After trying to upgrade my flutter apps dependencies failed, I've seen a command in the call stack and tried to run it. Now I think I screwed up my local ruby installation with my workarounds. I would like to know if I could retrace my steps to get the original ruby setup without my workarounds, without reinstalling the OS or is it fine the way it is?

Possible important information:

  • Ventura: 13.0
  • XCode: 14.01

Here is a summary of what I've done:

It was: sudo gem pristine ffi --version 1.15.5, but instead of fixing stuff it broken even more. Some things were missing and I tried to get back to it's original state.

I've found this answer. Now I tried to reinstall cocoapods which was apperantly broken by running: sudo gem install cocoapods.

Didn't work out because of some missing ruby/config.h headers apperantly. After researching I once again found an answer:

    1. I ran: cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby
    1. There I created the systemlink: sudo ln -sf ../../../../Headers/ruby/config.h
    1. Afterwards I navigated one folder up: cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0
    1. And here I needed to do something different from the original answer: I needed to run: sudo ln -sf universal-darwin21 universal-darwin22

I've also installed the xcode cli 14.2 beta thing, but that didn't help either.

Now the App I tried to upgrade is broken, but a different one seems to work, so I think not everything is broken on the system, at least I hope so.

  • I got exactly the same issue with my Flutter app: installed XCode 14.0.1, upgraded to Ventura and got broken Ruby 2.6 (config.h is gone). Maybe it's not a solution for you, but for me installing Ruby 3.1.2 with brew worked: stackoverflow.com/a/68118750/1435891. At least I was unblocked and able to build with fastlane. Hope that helps. Oct 28, 2022 at 3:04

2 Answers 2


Passing RUBY_CFLAGS="-w" worked for me on MacOS Ventura M1 Max. example:

RUBY_CFLAGS="-w" rbenv install 2.4.0

Same issue Xcode 14.2 14C18 on Monterey, when I try to install cocoapods, (homebrew version is lag behind). I am luckier than you. I follow this https://stackoverflow.com/questions/64070241/install-ruby-development-tools-for-gem-installation-on-osx-catalina

And got ruby and the latest cocoapods. I take all the steps, but I think the essential elements only:

xcode-select --install #(for toolchain)
brew install rbenv ruby-build
rbenv install 3.1.2 (your choice) #which will install Ruby from source with regardless to installed Xcode.
sudo gem install cocoapods


  • It’s good that you provide the link to StackOverflow, but it’s immensely more helpful if you provide a summary of the essential elements here so it’s not necessary to leave the page/site to get an answer.
    – Allan
    Feb 3 at 18:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .