The new MAC system is 11.4, and the installed Xcode version is 13.2.1
after opening a unity project and switching to IOS platform, cocoapods is installed in the background, but an error is reported indicating that the installation fails:
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Framewoks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220311-4106-wxounc.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Framewoks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development environment,ruby-dev or ruby-devel for example.
According to the error prompt and query from the network, it should be that a new Ruby Version needs to be installed, and the ruby provided by the system cannot be used
installing Ruby requires RVM, and installing RVM requires homebrew
Install homebrew
Use the command /usr/bin/Ruby - e" $(curl - fssl) is not used here https://raw.githubusercontent.com/Homebrew/install/master/install )"
After installation, execute brew update
update.
Then execute brew -v
to see the installed version
Install RVM
Install RVM curl -L https://get.rvm.io | bash -s stable
reload RVM environment source ~/.rvm/scripts/rvm
View RVM version
RVM -v
Install Ruby
Check the known version of ruby RVM list known
check the installed version of ruby RVM list
Install a ruby version. I chose 2.6.5 RVM install 2.6.5
After installation, check the Ruby Version Ruby -v
. If it is not the version just downloaded, I need to use the command to cut the version
Install cocoapods
After the above installation, execute sudo gem install cocoapods -n/usr/local/bin
to install cocoapods
after the installation, execute pod --version
to view the version of cocoapods
Here, for unit packaging, cocoapods are not completely installed. You need to continue to follow the following steps.
Command + Shift + G, open to the folder
pop-up window, and enter ~/.cocoapods, after opening the cocoapods folder, delete all the contents under it, create a new repos folder, open the command line tool, and execute the following three commands in turn
1) cd ~/.cocoapods/repos
2) git clone --depth 1 https://github.com/CocoaPods/Specs.git master
3) pod repo update
In this way, the Xcode project exported by unity will have Xcworkspace file (in case of problems in cocoapods environment, the exported Xcode project only has .xcodeproj file, and there are many exceptions when using this file for packaging press conference), and then open the file with Xcode for subsequent publishing
Read More:
- Cocoapods Install ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.
- [Solved] Xcode13.1 Upgrade Error: CocoaPods installed but not working Failed to build gem native extension
- [Solved] Unity Import Xcode Project Error: iOS framework addition failed due to a CocoaPods installation failure.
- Cocoapods Upgrade Error: ffi * * * * [How to Solve]
- How to Solve Cocoapods Installation Failure
- [Solved] cocopod Error: failed: undefined method `map‘ for nil:NilClass
- M1 Computer: How to Solve pod update
- [Solved] cocoapods Error: Runtimeerror – [xcodeproj] unknown object version
- [Solved] Mac homebrew error: Error: homebrew-core is a shallow clone.
- M1 MacBook pod install Report an error chip incompatibility problem
- How to Solve brew ERROR in `initialize‘: Version value must be a string; got a NilClass ()
- HTTP Error 500.30 – ANCM In-Process Start Failure
- How to Solve ruby rails Install Error [Windows]
- [Solved] NPM Error: gyp: No Xcode or CLT version detected!
- MAC install lightgbm and xgboost Error [How to Solve]
- [Solved] The Ruby zlib extension was not compiled
- Pod install Error: LoadError [How to Solve]
- How to Solve Xcode M1 simulator Error
- [app] install and compile libimobililedevice, How to solve the error
- Docker service startup error: Job for docker.service failed because the control process exited with error code.