CocoaPods install doesn't install pods - macos

I'm in terminal and I've "installed Cocoapods" however when I go to list the pods it retrieves nothing.
XXX-MBP:Desktop XXX$ sudo gem install cocoapods
Password:
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
1 gem installed
XXX-MBP:Desktop XXX$ pod list
0 pods were found
XXX-MBP:Desktop XXX$
Then when I go to search for a particular pod it goes into repo mode and stops.
Thanks in advance!

Related

Invalid Podfile file: undefined method `enable_user_defined_build_types!'

I have installing gem on a Macbook Pro running Big Sur and M1 chip. I have followed the instructions given, added these two lines on top of my Podfile
plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!
then I am running the command
sudo gem install 'cocoapods-user-defined-build-types'
and gem is getting installed see below -
Successfully installed cocoapods-user-defined-build-types-0.0.7
Parsing documentation for cocoapods-user-defined-build-types-0.0.7
Done installing documentation for cocoapods-user-defined-build-types after 0 seconds
1 gem installed
Now, as soon as I run pod install, I get this error -
[!] Invalid Podfile file: undefined method `enable_user_defined_build_types!' for #<Pod::Podfile:0x0000000145251098 #defined_in_file=#<Pathname
Any idea what excatly is the problem here?
I solved this issue by installing specific version of cocoapods with gem.
Open a terminal in your Xcode project folder and run the commands below:
gem cleanup
brew uninstall cocoapods
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.10.0 -n /usr/local/bin
sudo gem install cocoapods-user-defined-build-types
pod install --repo-update
NOTE! If you using react-native before pod install --repo-update delete your node_modules folder and install again using npm
I was struggling to get a solution,
I was trying to install the snapkit and Firebase through cocoapods, I got pod init, but after insert inside the podfile the e.g. Snpakit when I tried the comand pod install i got this issue
[!] Invalid Podfile file: undefined method......
What solved for me
I installed the brew through terminal and by brew I reinstalled cocoapods
another thing that was crucial...
when I typed insert my pod
pod 'SnapKit', '~> 5.6.0'
The Podfile, automatically change de first character to uppercase
Pod 'SnapKit', '~> 5.6.0'
After you type your pod, try to leave the word pod in lowercase, after save and close, go to terminal and try again pod install
add gem 'cocoapods-user-defined-build-types' to your gemfile and run bundle install
this should work if the other solutions didn't

Invalid `Podfile` file: Unable to locate the executable `node`

I'm trying to run my App on IMB Cloud. Server run is OK. NPM Installed and Started. When POD Install from cd /ios it shows error:
denisbondar#MBP-Denis ios % pod install
[!] Invalid Podfile file: [!] Unable to locate the executable node.
# from /Users/denisbondar/Documents/kickapp/starter-kit/mobile-app/ios/Podfile:48
# -------------------------------------------
#
use_native_modules!
# end
# -------------------------------------------
Any thoughts? Thanks!
I had the same Issue. As I was trying to run a React Native App, and I needed some node module I have to run
brew install node
Just had the same issue, after updating cocoa pods the installation passed:
sudo gem install cocoapods
brew remove cocoapods && sudo gem install cocoapods
If you're running into this issue on an M1 Mac, this is what fixed it for me:
sudo arch -x86_64 gem install ffi
In your /ios directory:
arch -x86_64 pod install
I am aware that the commands I ran in order to fix my build have already been mentioned on this page, but I'll try to provide the order I ran them + some backstory.
For me the problem was that I've initally installed cocoapods using homebrew and I couldn't get it to update past version 1.5.2. Tried different approaches but pod --version still printed 1.5.2.
Then I've tried installing cocoapods using gems with:
sudo gem install cocoapods
Even if it displayed that the installation of cocoapods 1.10.1 was successful, the command line from terminal still pointed to the homebrew version of cocoapods, and pod --version still printed out 1.5.2. So I had to remove it, by calling:
brew remove cocoapods
After that the command line pointed to the gems version of cocoapods (1.10.1). And the build was successful.
BEWARE I AM MAC OS NOOBIE SO PROCEED WITH CAUSION FOR THE NEXT PART
Also, my friend tried to follow the exact same steps and his build still failed until he tried installing:
sudo arch -x86_64 gem install ffi
then after the installation he ran:
arch -x86_64 pod install
Again, I am a MAC OS noobie, so I don't understand very well yet what's the deal with this ffi. It just helped my friend getting his build done, so I thought it might also help somebody else.
For me problem was that I have cocoa pods installed by brew install cocoapods and brew install --cask cocoapods.
So to fix I run
brew remove cocoapods
brew remove --cask cocoapods
brew install cocoapods
After that I have latest version of cocoapods and everything worked.

Why can't my terminal find Cocoapods commands?

I am trying to use Cocoapods, but I'm stuck with even setting it up properly. It keeps showing me
-bash: pod: command not found
and I can't do anything. Also, the
$ pod init
doesn't work. I suppose the my computer cannot find any commands related to Cocoapods.
I've followed all the ways that was listed on the Cocoapods website, and read from websites such as raywenderlich but nothing helped.
$ sudo gem install cocoapods
Successfully installed cocoapods-1.7.5
Parsing documentation for cocoapods-1.7.5
Done installing documentation for cocoapods after 2 seconds
1 gem installed
$ pod setup --verbose
-bash: pod: command not found
I expect it to clone the CocoaPods Master Specs repository into ~/.cocoapods/ on my computer. Please help.
I actually thought you'd get the "You don't have write permissions for the /usr/bin directory." error, but your successfully installing it. I'm not sure why it's installing it in and then reading from another.
Try installing in a different directory:
sudo gem install -n /usr/local/bin cocoapods
For more see here

Ruby gems. Unable to add sources

I had this problem "https://stackoverflow.com/questions/19612185/unable-to-install-cocoapods-gem-from-rubygems-org-bad-response-backend-read-e" and as one of the solutions said I tried to remove/add rubygem sources. It was removed without problem, but when I tried to add it back it's giving me an error.
Here's my action on terminal and response:
$ gem sources --add https://rubygems.org/
Error fetching https://rubygems.org/:
server did not return a valid file (https://rubygems.org/specs.4.8.gz)
Does anyone know what is the problem?
Here is Easy Steps for installing Ruby in your system to help to install Cocoapods in your machine, I solved the same issue with being below mentioned steps.
Install command line tools using the command
xcode-select --install
Install Homebrew by
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Ruby using homebrew
brew install ruby
Check Ruby version
ruby -v
Install Ruby
gem source -a http://rubygems.org/
gem install cocoa pods
sudo gem install cocoapods
or
sudo gem install -n /usr/local/bin cocoapods
Go to below folder
cd ~/.cocoapods/repos
Run the below command
git clone https://github.com/CocoaPods/Specs.git master
Go to the directory where Podfile is present and run
pod install
Happy Coding😊
Steps:
1. sudo gem install cocoapods
2. pod install
3. pod update
ensure that you are connected to internet. Your system is unable to find the latest version of gems, required by pods

My cocoapods lost a lot of Framework

My cocoapods like this:
$ pod list
424 pods were found
$ pod --version
0.29.0
Someone else's computer like that:
$ pod list
4281 pods were found
$ pod --version
0.31.0
How do I do like that?
Run
[sudo] gem install cocoapods
Again to get the newest version of the command line tool. To setup the master repo you then run
pod setup

Resources