Xcode - installing cocoapods - xcode

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

Related

Flutter cocoapods version conflict (Installed But Not Working)

so simply i am trying to archive my flutter project using Xcode to push it through apple store connect review process, i faced a problem that declare that the cocoapods version is old .. i am using cocoapods through cocoapods app not the gem ..
i simply uninstalled the app cause it's the lastest version of the app (Not of cocoapods) and then uninstalled any cocoapods related previous gems so that cocoapods is totally uninstalled on my machine (M1 Macbook Air) & installed the cocoapods gem using sudo gem install cocoapods .. on flutter doctor -v in my device ~ it shows me that cocoapods is installed but now working
[!] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 ✗ CocoaPods installed but not working. 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. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
and the weird thing that when i try to re-install cocoapods first i run
gem list --local | grep cocoapods
then i uninstall everything that shows up using sudo gem uninstall command after that when i try flutter doctor -v it still shows me that it's installed but not working, But how when I uninstalled the application and the gems and everything related
Take in mind that when i run pod related command after the gem and application uninstallation it shows me this [!] Unable to locate the CocoaPods.app application bundle. Please ensure the application is available and launch it at least once. zsh: illegal hardware instruction pod.. any Ideas Or Solutions?

Cannot install Colorls on MacOS

I'm trying to install Colorls on two separate MacBooks here (one Big Sur and the other one Monterey) but if I run:
sudo gem install colorls
I get this error:
ERROR: Error installing colorls:
ERROR: Failed to build gem native extension.
I tried several different solutions but still no chance.
Any help?
Run this command to install all the developer tools (such as clang, make and libc) which are usually dependencies of native gems.
xcode-select --install

Error installing cocoapods on Catalina 10.15.2

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

how to install ruby-Tk on mac OSX catalina 10.15.4, ruby-2.6.3

Please could anyone help me with the best step by step instruction to install ruby-Tk on mac OSX catalina 10.15.4 running ruby-2.6.3. doing
gem install tk
gives me this error. "Can't find "tk.h". Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk." Thanks
Below guide assumes you have Xcode already installed. If not install it first from the apple app store.
1) Install ActiveTcl for macOS from https://www.activestate.com
under applications/utilities, there will be a new app wish.app. run this app and if you get the wish console to open, then, it installed ok
2) Using your command line do the following
brew install ruby #this will install latest version of ruby
gem install tk
3) then add other ruby gems that you need for your development environment.

Error for macos sierra install cocoapods

When i install mac os sierra, trying install cocoapods, but appear error:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
but i already installed openssl and ruby,i really don't know is why,does anyone know?
Install Cocoapods by below 3 commands
sudo gem update --system -n/usr/local/bin
sudo gem install -n /usr/local/bin cocoapods
pod setup

Resources