When I installed cocoa pods I got this message. The cocoa pods downloaded is in version 1.10.1. Ive tried to use the command they give but this appears:
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1 ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Does it means that the latest version available is 1.13.1 but I can't use it because of a problem? How to solve it?
110 Answers
Basically, you need to do what the warning message says: install the Gem "ffi" in the specified version by running gem pristine ffi --version 1.13.1. However, usually you don't have write permissions on the system to install a Gem into the stated directory.
You could probably just use sudo, i.e. run the command sudo gem pristine ffi --version 1.13.1 and enter the password, but I guess this is generally not recommended as it is a security risk.
I installed it like this:
gem install ffi --version 1.13.1 --user-installThen I had to add the installation path to my PATH variable; in my case I added this line to my ~/.zshrc:
export PATH=$HOME/.gem/ruby/2.6.0/bin:$PATHI'm really not an expert on Ruby stuff, but this solved the issue for me.
0This solved the issue for me
brew install cocoapodsshould already be linked (as pointed out by Raphael Pinel) but if you want to make sure run
brew link --overwrite cocoapods 5 On Monterey. I did this:
pod install --repo-update
.....Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
% brew install cocoapods
% brew link --overwrite cocoapods
% brew outdated
% brew upgradeBut, same problem.
% pod install --repo-update
result... Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3I don't have permission to install it in that directory.
1in my case ( mbpm1 pro ) , my other project are fine , but some project from my friend ( windows only) i got some issue , i fixed by
arch -x86_64 sudo gem install ffiflutter cleandont forget to clean after installing some gemflutter pub getre get- run now ( these run would automatically run pod install ) just click on main.dart ( vscode )
None of the answers worked for me. So, I thought of uninstalling all versions of ruby which I had unknowingly installed, and keeping only the one installed by Xcode.
brew uninstall --force rubyThen, uninstalled cocoapods
brew uninstall --force cocoapodsI was left with the ruby installed by XCode. I ran:
gem pristine ffi --version 1.15.3I realised the other versions got installed in ~/.local
I deleted the whole folder as it had nothing other than the old gem folder
rm -rf ~/.localNow, reinstall cocoapods:
brew install cocoapodsTry running:
pod installOR
gem -vYou should not see this error.
This usually happens when you have multiple gem versions installed and the path is incorrect.
P.S I am using macOS Monterey 12.1
In my case I had paths mismatch, this command helped me:
rvm get stable --auto-dotfilesAlso check paths order in you .zshrc file
f.e.
# Ruby
export PATH="~/.rvm/gems/ruby-2.6.0/bin:$PATH"
export PATH="/usr/local/opt/ruby/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"
# User local
export PATH="/usr/local/bin:$PATH" My issue was that the pre installed ruby had those extensions installed and caused the error messages. Do as follows
See all installed messages, should also print the Ignoring ... because its extensions are not built. Directly reference /usr/bin/gem since you might have ruby installed via brew which would be called otherwise.
/usr/bin/gem listThen manually uninstall all mentioned extensions for the default ruby. Do this for all extensions that cause the message.
sudo /usr/bin/gem uninstall ffi This worked for me :
sudo gem pristine ffi (don't write a version here, because it will fix the problem of all versions)
then,
pod install
Start the Terminal on a Mac M1 with Rosetta and run
pod update "You need to install rbenv and get control of your Ruby before trying to use pods - matt"