'react native, installing cocoapods result: Folly can't modify frozen String (FrozenError)

When attempting to install cocoapods in an existing react native project, I get the following error:

Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)

I'm not sure of the root cause. At first I thought it was a problem with Apple Silicon (M1), but a colleague using an x64 encountered the same problem.

Versions:

   "react": "^17.0.2",
    "react-native": "0.64.1",

I've combed through every related question I could find here. I haven't found one with a workable solution. Let me know if you need more info. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source