8

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?

Ashar
  • 724
  • 10
  • 30
  • 1
    I fix this issue using @Alsh compiler here https://stackoverflow.com/questions/63650689/package-configuration-for-libffi-is-not-found-in-macos-while-installing-travis-c – Ashar Mar 24 '21 at 15:53

2 Answers2

15

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
MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65
4

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 :)

Akif
  • 73
  • 5