I'm setting up flutter on my machine. However when I try to install cocoapods by using
sudo gem install cocoapods
I get this error:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210324-1667-1wwdce5.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... yes
checking for ffi_prep_closure_loc() in -lffi... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR="
make: *** No rule to make target `"/Volumes/macOS', needed by `AbstractMemory.o'. Stop.
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.0/gem_make.out
Is this caused by the fact that partition name contains 'space' in its name? My drive name on which OS is install is 'macOS Big Sur' while flutter resides on another partition which is 'macOS Storage'
Can someone please help?
To find if Cocoapods is installed or not run cmd (pod --version). if theresult is (Not Found) Pods is not installed.
It will not be possible to install Cocoapods in the generated Xcode project which will result in link errors when building your application. 'gem install activesupport -v 4.2.6 --user-install' failed with code (1):
After installing CocoaPods I switched back to the latest command-line tools and did 'pod install' on one of my current projects, which succeeded without incident. So the earlier version seems necessary only for CocoaPods install, not its operation.
Seems Unity still try to install cocoapods even if you have already installed cocoapods, and there are also something wrong when calling cocoapods via Shell. Hope this may help someone.
You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods.
This would be resolved by:
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
If you needed to install CocoaPods 1.10.0 +
you can use HomeBrew and use the command below in your command line:
brew install cocoapods
I have confronted the same error under BigSur, and I figured out a strange thing when I tried to install cocoa in traditional way. The https://cocoapods.org address gave "Internal Server Error". And that means something wrong at cocoa servers. So I planned to install the new version of cocoa using home-brew.
I used the above code to install home-brew to Mac.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, I uninstalled current old version cocoapods, using the command below
sudo gem uninstall cocoapods
Then, I installed new version of cocoa pods using home-brew,
brew install cocoapods
Then, I used the command below to fix the inconsistencies.
brew link --overwrite cocoapods
And victory :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With