tns doctor not working. WARNING: There was a problem with CocoaPods - nativescript

I tried installing Nativescript on my machine and successfully ran all the commands but when I ran TNS doctor I got the following error.
Verifying CocoaPods. This may take more than a minute, please be patient.
Installing iOS runtime.tns-ios#2.1.1 ../../var/folders/pr/zxhdgq354w36_v4jnkyg89fr0000gn/T/nativescript-check-cocoapods11679-71167-clmpmh/node_modules/tns-ios
Verifying CocoaPods. This may take some time, please be patient..
sandbox-exec: /Users/myname/.rvm/gems/ruby-2.3.1#global/gems/cocoapods-1.0.1/bin/pod: Operation not permitted
WARNING: There was a problem with CocoaPods
Verify that CocoaPods are configured properly.
There seem to be issues with your configuration.
1
I have googled around for a fix but could not get any answer e.g. https://github.com/NativeScript/nativescript-cli/issues/1943
There was a mention of chmodding ./Pods but that didn't work. Has anyone else had this problem and fixed it?
I have installed and checked cocoapods but it still yields the same error.
Last login: Tue Aug 9 19:24:23 on ttys000
XXX-MacBook-Air:~ mine$ sudo gem install cocoapods
Password:
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
Done installing documentation for cocoapods after 4 seconds
1 gem installed
XXX-MacBook-Air:~ mine$ pod --version
1.0.1
`

Install your CocoaPods with superuser permissions.
sudo gem install cocoapods
And then check if they are installed correctly
pod --version
Also, you might want to update your XCode version if you are using older one.
Refer to this issue for similar problem discussed.

You will need a lower version of cocoapods first you will need to remove your current version sudo gem uninstall cocoapods then you can proceed to install
sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods -v 0.39.0
After installing cocoapods you can try creating a demo app and run it
tns create demoApp
cd demoApp
tns run ios
You can ignore tns doctor for now

After some research I found the right answer (at least for me) and paste it for future references.
currently using:
MacOs Sierra with
xcode: v7.3.0
cocoapods: v1.0.1
nativescript: v2.3.0
node: v6.8.1
Steps:
Locate your node_modules folder where your global npm packages are installed (I am using nvm version manager and node v6.8.1 so it was /Users/myuser/.nvm/versions/node/v6.8.1/lib/node_modules/nativescript/config).
open node_modules/nativescript/config/config.json
Change the value of USE_POD_SANDBOX to false
Reason (as act of faith): NativeScript uses the sandbox-pod executable. This may prevent some pods from installing correctly. If you encounter such cases, you can switch to the regular pod executable.
original source: https://github.com/NativeScript/nativescript-cli/issues/1943#issuecomment-246186556

[Cocoapods problems][1]
[1]: https://i.stack.imgur.com/fCWVI.png
[continue Cocoapods problems][2]
[2]: https://i.stack.imgur.com/trSvT.png
[continue Cocoapods problems][3]
[3]: https://i.stack.imgur.com/iwvhK.png

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?

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.

zsh: command not found: pod - MAcOS Catalina 10.15

I'm running the install with an admin account I tried
sudo gem install cocoapods
and
sudo gem install cocoapods -n /usr/local/bin
They both run fine with following output
Fetching cocoapods-1.9.1.gem
Successfully installed cocoapods-1.9.1
Parsing documentation for cocoapods-1.9.1
Installing ri documentation for cocoapods-1.9.1
Done installing documentation for cocoapods after 2 seconds
1 gem installed
however, a simple
pod --version
Returns
zsh: command not found: pod
I'm not too good at managing users accounts or dealing with command shell but I scoured the net and couldn't find a solution. It looks like wherever pod is installed, it doesn't make it to the list of executable applications
The issue was that command line for XCODE was not installed.
First I updated to latest Ruby version and put the version number in the second command (in place of [version]
curl -L https://get.rvm.io | bash -s stable
rvm install ruby-[version]
During the install you will see the Software update available from MAcOS popup. Install immediately and continue with prompts in that window (I believe it asks for updates and then asks for install.
It will take a while to run / download / install (it took 2 expressos for me :) )
After that I ran
sudo gem install cocoapods
And restarted my terminal.
Now checking it's installed
pod --version
Returns the installed version (1.9.1 for me)
I followed these instructions but ended up with the same issue. So I ran gem list | grep cocoapods and then uninstalled every instance of cocoapods with gem uninstall cocoapods along with the executables. Then I decided to install cocoapods using Homebrew with brew install cocoapods, restarted my Mac and the pod command was available. Remember I didn't restart my Mac after using sudo gem install cocoapods,maybe that will work too, you can try.

Hyperloop error when processing Cocoapods dependencies

After downloading the hyperloop-examples files, and running appc ti build -p ios, I get errors when Hyperloop finds the CocoaPods dependencies.
The exact error text is:
[ERROR] An error occurred during build after 3s 372ms
[ERROR] pod install returned a non-zero exit code
The only change I had to make was to set sdk-version in tiapp.xml to 5.4.0.v20160608165242 instead of 5.4.0 (pulled this version of the SDK by running appc ti sdk install -b 5_4_X)
appc -v returns 5.2.2
appc ti -v returns 5.0.6
Also, if I remove the Podfile file, the app builds and runs on the simulator. Most of the samples work (obviously not the Third-Party Libraries one). I see in some of the other issues where people were able to get the cocoapod dependencies working, so this may just be a cocoapod issue with my machine.
pod --version returns 1.0.1
pod install provides the error:
Could not automatically select an Xcode project. Specify one in your Podfile like so:
Version 1.0.1 of cocoapods does not work with hyperloop right now. Uninstalled that version and installed 0.39.0 instead resolved the issue.
sudo gem install cocoapods -v 0.39.0
One way that worked for me:
Remove cocoapods
gem uninstall --all --executables cocoapods
Install it again
sudo gem install cocoapods
Make sure you're running latest node lts (4.5.0)
Re-open Appc Studio to see it works

Install Cocoapods on El Capitan. "pod: command not found" [duplicate]

I installed pod some time ago. However, it's stopped working so I'm working through this again.
However, I almost immediately run into a problem here:
pod install
-bash: pod: command not found
Any suggestions why this happened?
OK, found the problem. I upgraded Ruby some time ago and blasted away a whole load of gems. Solution:
sudo gem install cocoapods
For none-sudo use:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
gem install cocoapods --user-install
Installing CocoaPods on OS X 10.11
These instructions were tested on all betas and the final release of El Capitan.
Custom GEM_HOME
This is the solution when you are receiving above error
$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
0.38.2
This Step Is Proper Working.
Pod Install
[ 1 ] Open terminal and type:
sudo gem install cocoapods
Gem will get installed in Ruby inside the System library. Or try on 10.11 Mac OSX El Capitan, type:
sudo gem install -n /usr/local/bin cocoapods
If there is an error "activesupport requires Ruby version >= 2.xx", then install the latest active support first by typing in the terminal.
sudo gem install activesupport -v 4.2.6
[ 2 ] After installation, there will be a lot of messages, read them and if no error found, it means cocoa pod installation is done. Next, you need to set up the cocoa pod master repo. Type in terminal:
pod setup
And wait it will download the master repo. The size is very big (370.0MB in Dec 2016). So it can be a while. You can track the download by opening Activity and go to the Network tab and search for git-remote-https. Alternatively, you can try adding verbose to the command like so:
pod setup --verbose
[ 3 ] Once done it will output "Setup Complete", and you can create your XCode project and save it.
[ 4 ] Then in a terminal cd to "your XCode project root directory" (where your .xcodeproj file resides) and type:
pod init
[ 5 ] Then open your project's podfile by typing in terminal:
open -a Xcode Podfile
[ 6 ] Your Podfile will get open in text mode. Initially, there will be some default commands in there. Here is where you add your project's dependencies. For example, in the podfile, type
/****** These are Third party pods names ******/
pod 'OpenSSL-Universal'
pod 'IQKeyboardManager'
pod 'FTPopOverMenu'
pod 'TYMActivityIndicatorView'
pod 'SCSkypeActivityIndicatorView'
pod 'Google/SignIn'
pod 'UPStackMenu'
(this is For example of adding library to your project).
When you are done editing the podfile, save it and close XCode.
[ 7 ] Then install pods into your project by typing in terminal:
pod install
Depending on how many libraries you added to your podfile for your project, the time to complete this varies. Once completed, there will be a message that says
"Pod installation complete! There are X dependencies from the Podfile and X total pods installed."
For macOS:
brew install --cask cocoapods
Original answer (outdated):
brew install cocoapods
brew cask install cocoapods-app
You have to restart Terminal after installing the gem. Or you can simply open a new tab Terminal to fix.
for M1mac people
first install cocoapods
brew install cocoapods
and if you are doing this for ios react-native
pod install
I had the same problem, running Mountain Lion with Ruby 2 installed and used instead of system ruby.
Previously I added PATH=/usr/local/bin:$PATH to my ~/.bash_profile as a way to make sure stuff installed by homebrew, including Ruby 2, took precedence over system-installed binaries.
Anyway, in this case I noticed that cocoapods would install their 'pod' binary not in /usr/local/bin but rather in /usr/local/Cellar/ruby/2.0.0-p247/bin/
So to my .bash_profile I added PATH=$PATH:/usr/local/Cellar/ruby/2.0.0-p247/bin/
and now cocoapods is working like a charm.
Uninstall all instances of cocopods by this command
$sudo gem uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
sudo chmod +rx /usr/local/bin/
Try this:
sudo gem install cocoapods -V
and you must update gem to the newest release using this:
sudo gem update --system
if you want to enjoy the fast responce :)
try:
rbenv global system
and then
sudo gem install cocoapods
pod setup
Sudo-less installation
If you do not want to grant RubyGems admin privileges for this process, you can tell RubyGems to install into your user directory by passing either the --user-install flag to gem install or by configuring the RubyGems environment. The latter is in our opinion the best solution. To do this, create or edit the .profile file in your home directory and add or amend it to include these lines:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
Note that if you choose to use the --user-install option, you will still have to configure your .profile file to set the PATH or use the command prepended by the full path. You can find out where a gem is installed with gem which cocoapods. E.g.
$ gem install cocoapods --user-install
$ gem which cocoapods
/Users/eloy/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb
$ /Users/eloy/.gem/ruby/2.0.0/bin/pod install
Source: https://guides.cocoapods.org/using/getting-started.html
In terminal it's better to run installation of the cocoa pods with "sudo". In other case I'm getting an error: "You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory."
So the solution is:
sudo gem install cocoapods
so I also had the same problem. This is probably happening because your computer has an older version of ruby. So you need to first update your ruby. Mine worked for ruby 2.6.3 version.I got this solution from sStackOverflow,
You need to first open terminal and put this code
curl -L https://get.rvm.io | bash -s stable
Then put this command
rvm install ruby-2.6
This would install the ruby for you if it hasn' t been installed.After this just update the ruby to the new version
rvm use ruby-2.6.3
After this just make ruby 2.6.3 your default
rvm --default use 2.6.3
This would possibly fix your issue. You can now put the command
sudo gem install cocoapods
And the command
pod setup
I hope this was useful
This solution worked for me. Make sure to not miss the last command (export PATH=$PATH:$HOME/Software/ruby/bin).
See This.
install cocoapods from https://cocoapods.org/app
Commands & versions keep onchanging
so download tar and enjoy
gterzian is on the right track, however, if you later update your version of ruby then you'll also have to update your .profile to point to the new versioned ruby directory. For instance, the current version of ruby is 2.0.0-p353 so you'd have to add /usr/local/Cellar/ruby/2.0.0-p353/bin to your path instead.
A better solution is to add /usr/local/opt/ruby/bin to your PATH. /usr/local/opt/ruby is actually a symlink to the current version of ruby that homebrew automatically updates when you do an upgrade. That way you'll never need to update your PATH and always be pointing to the latest version.
it happens to me when I wrote
gem install cocoapods
instead of
sudo gem install cocoapods
if sudo command is not found also, write
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH
before sudo command
If you used homebrew to install ruby, this answer worked for me.
brew unlink ruby && brew link ruby
OSX 10.9.4
#Babul Prabhakar was right
IMPORTANT:
However,if you still get "pod: command not found" after using his solution, this command could solve your problem:
sudo chown -R $(whoami):admin /usr/local
Please remove the Ruby folder from -Your Disk->Library->Ruby
Deleting this folder and use sudo gem install cocoapods command to solve my issue.
The best solution for Big Sur is posted on Redit by _fgmx
Go into Xcode 12 preferences Click locations Select Xcode 12 for Developer tools/command line tools Install cocoapods for Xcode 12: sudo gem install cocoapods
This worked for me
sudo apt-get install ruby-dev
sudo gem install cocoapods
CocoaPods is built with Ruby and it will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing.
sudo gem install cocoapods
Resource: https://guides.cocoapods.org/using/getting-started.html
We were using an incompatible version of Ruby inside of Terminal (Mac), but once we used RVM to switch to Ruby 2.1.2, Cocoapods came back.
Install pod
sudo gem install cocoapods
Navigate inside platforms/ios
cd platforms/ios
Run pod install
I'm using OS Catalina and used the solution of Babul Prabhakar.
But when I closed the terminal, pod still was unable.
So I put the exports:
$ export GEM_HOME=$HOME/Software/ruby
$ export PATH=$PATH:$HOME/Software/ruby/bin
inside this file(put this command below inside the terminal):
nano ~/.bash_profile
Then save the file, close the terminal and open it up again and type:
pod --version
this link help me a lot
it work now for me on catalina (patched for macbook pro 2011) with xcode 12.4.
may sure that you don't have another older version on your mac, for me having an old xcode 10.x in my download folder caused me many issue, so read verbose instruction in terminal, that help me to solve my problem.

Resources