Skip to content

Instantly share code, notes, and snippets.

@Pacek
Last active May 4, 2021 14:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pacek/144be424e047297a928a9fd51f96b6b2 to your computer and use it in GitHub Desktop.
Save Pacek/144be424e047297a928a9fd51f96b6b2 to your computer and use it in GitHub Desktop.
How to fix Ruby Bundler on Big Sur beta

THE PROBLEM

After updating to macOS Big Sur beta you might encounter issues when using Ruby Bundler to manage Ruby gems in your project - in our case to install CocoaPods and Fastlane for iOS development.

Ignoring json-2.2.0 because its extensions are not built. Try: gem pristine json --version 2.2.0

...

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

...

fatal error: 'ruby/config.h' file not found

THE SOLUTION

  1. Make sure you have the latest Xcode and Command line tools installed in a correct directory
  2. softwareupdate --all --install --force
  3. sudo rm -rf /Library/Developer/CommandLineTools
  4. sudo xcode-select --install
  5. Install Rbenv to manage Ruby versions
  1. Install Ruby 2.7.2
  • rbenv install 2.7.2
  • rbenv global 2.7.2
  • ruby -v should now return ruby 2.7.2 ...
  1. Reinstall CocoaPods and Fastlane
  • gem uninstall cocoapods
  • rm /usr/local/bin/pod
  • gem uninstall fastlane
  • rm /usr/local/bin/fastlane
  • gem install cocoapods - no sudo
  • gem install fastlane - no sudo
  • which fastlane and which pod should now return /Users/username/.rbenv/shims/...
  1. Profit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment