This question already has answers here:
Error installing cocoapods : Failed to build gem native extension
(2 answers)
Closed 3 months ago.
When I try to install Cocoapods using sudo gem install cocoapods, I get the follow error output:
This is happening on a MacBook Pro with an M1 chip.
Do this, with M1 chipset you need to use home brew instead gem
sudo gem uninstall cocoapods
brew install cocoapods
Related
System
OS : macOS (12.6.1)
CPU : Intel (R) Core - i5
JAVA : OpenJdk 19
Xcode : 14.1
ruby : 2.7
gems : 3.3.11
Im trying to set up the environment for Kotlin Multiplatform for iOS and Android i installed kdoctor, Xcode, Android Studio,OpenJdk and ruby2.7.
Everything is working according to plan but i'am not able to install cocoapods and cocoapods-genrate i tried official documentation of cocoapods https://guides.cocoapods.org/using/getting-started.html#installation and used this command. but kdoctor is not ditectiong cocoapods,
sudo gem install cocoapods
i also tried brew method by this command
brew install cocoapods
now cocoapods is detected but cocoapods-genrate plugin is not detected. and showed this message
"* cocopods-genrate plugin not found
Get cocopods-genrate from https://github.com/square/cocoapods-generate#installation"
i tred this command but nothing happend.
gem install cocoapods-generate
how to properly install cocopods and cocopods-genrate to set up the environment for Kotlin Multiplatform for iOS and Android?
I used this command to install cocoapods
sudo gem install -n /usr/local/bin cocoapods
Then this command to install cocoapods-generate
sudo gem install -n /usr/local/bin cocoapods-generate
and finaly pod setup --verbose to setup the cocoapods.
I followed this answer and now cocoapods and cocoapods-generate is ditected by kdoctor.
How do I install CocoaPods?
it's my first using macOS I downloaded big sur version and I had install flutter
when I run flutter doctor I see this problem
Idk how to solve it
and i saw many answers here but still not working
it fixed when i install homebrow
If you are using an M1 mac, you can download ffi first by this command:
sudo arch -x86_64 gem install ffi
then run pod commands like this :
arch -x86_64 pod install
I just start learning swift and found I can get a lot of libraries from cocoapods, so I start installing the cocoapods by running sudo gem install cocoapods, however I got the following error during the installation:
Successfully installed concurrent-ruby-1.1.6
Successfully installed i18n-0.9.5
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.7
Successfully installed activesupport-4.2.11.3
Successfully installed nap-1.1.0
Successfully installed fuzzy_match-2.0.4
Successfully installed httpclient-2.8.3
Successfully installed algoliasearch-1.27.2
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.12.2/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 ./siteconf20200527-3399-1uix5ob.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/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.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
I am running macOS Catalina 10.15.2 with Xcode 10.3, not sure is that because of the masOS is outdated, if so is there any way that I can fix the installing issue without updating the macOS?
Same thing happened to me after I erased Macintosh HD from macOS Recovery > Disk Utility and then reinstalled macOS Catalina from macOS Recovery too.
Now, I'm on macOS Catalina 10.15.7 and this error happened when I ran sudo gem install cocoapods.
I'm not sure yet why, but installing cocoapods via Homebrew worked for me.
brew install cocoapods
brew install cocoapods
If you don't have Homebrew yet, run the following on your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
This question already has answers here:
Can't install gems on OS X "El Capitan"
(15 answers)
Closed 7 years ago.
After installing OS X El Capitan (10.11) my ruby compass is no longer working. After trying to install compass I recieve error message like this:
$ sudo gem install compass
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/compass
How this can be fixed?
I had the same problem after upgrading to OS X El Capitan (10.11), but while trying to sudo gem install sass. The poster's solution of putting the path in the install command worked for me, and installing compass also installs sass, so: sudo gem install -n /usr/local/bin compass did the trick. Thanks Leo!
The fix I found was simply to put the PATH in the install command for any ruby gem package:
$ sudo gem install -n /usr/local/bin GEM_PACKAGE_NAME
So with compass it worked for me as:
$ sudo gem install -n /usr/local/bin compass
Good Luck!
I am trying to install cocoapods on my MacBook Pro which is running OSX Mavericks and version 5.02 of Xcode and get the following error when I run the sudo gem install cocoapods:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ENOMEM: Cannot allocate memory - connect(2)
(https://rubygems.org/latest_specs.4.8.gz)
I have a MacBook Pro with 256G SSD and 8G ram.
This problem is due to lack of proper Xcode Command Line Tools. Visit https://developer.apple.com/downloads/ and install the latest Command Line Tools that match your Mac OS and Xcode version. Then try running:
sudo gem install cocoapods