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?
10
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 commandsudo 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:
Then I had to add the installation path to my
PATH
variable; in my case I added this line to my~/.zshrc
:I’m really not an expert on Ruby stuff, but this solved the issue for me.
This solved the issue for me
should already be linked (as pointed out by Raphael Pinel) but if you want to make sure run
Start the Terminal on a Mac M1 with Rosetta and run
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.
Then, uninstalled cocoapods
I was left with the ruby installed by XCode. I ran:
I realised the other versions got installed in
~/.local
I deleted the whole folder as it had nothing other than the old
gem
folderNow, reinstall cocoapods:
Try running:
OR
You 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:
Also check paths order in you .zshrc file
f.e.
My issue was that the pre installed ruby had those extensions installed and caused the error messages. Run the command below to
see all installed packages. Said command should also print the error
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.Then manually uninstall all mentioned extensions for the default ruby.
in 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 ffi
flutter clean
dont forget to clean after installing some gemflutter pub get
re getThis worked for me :
then :
MacOS: Ventura v13.0
Updating the Ruby version worked like a charm. Did the following steps.
Installed the latest ruby version.
To activate the above version as global default version.
To install ffi
gem install cocoapods
This is a workaround and not a solution, but for me, after trying all other posted solutions (on Monterey 13.0.1, I traced it back to it seemingly picking the homebrew installed cocoapods picking up the ffi library from ~/.rbenv/shims, with the only timely work around being to install cocoapods via gem, per above.
All this said, I don’t claim to be well versed in rbenv, or any other dependency manager, for that matter.
I’d love to know a better answer that didn’t bork the homebrew based installation.