Unable to install latest version of cocoapods using homebrew.Always installing cocoapods1.5.2 in MacOS Catlina 10.15.7 - cocoapods

brew install cocoapods
pod --version
1.5.2
Not able to update to latest version 1.10.1

Related

cocopods-genrate plugin not found

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?

flutter doctor not finding cocoa pods

I have an issue that tells me to install cocoapods using gem, but the flutter doctor couldn't find it.
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0 20A2411 darwin-arm, locale en-IN)
• Flutter version 1.22.4 at /Users/kirandhoundiyal/flutter
• Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Volumes/apps/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Volumes/apps/Android/sdk
• ANDROID_SDK_ROOT = /Volumes/apps/Android/sdk
• Java binary at: /Volumes/apps/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ 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. For more info, see
https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
[!] Android Studio (version 4.1)
• Android Studio at /Volumes/apps/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
Also gem list pod is giving an empty list but sudo gem list pod is giving this
*** LOCAL GEMS ***
cocoapods (1.10.0)
cocoapods-core (1.10.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-trunk (1.5.0)
cocoapods-try (1.2.0)
I am first time doing this stuff, need some help, what's wrong?
EDIT: ruby -v gives this ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
which ruby gives this - /usr/bin/ruby
First try this ;
sudo gem uninstall cocoapods
sudo gem install cocoapods
If it does not works for you.
Try this :(It works for me in macos Bigsur M1)
Check permission for the mentioned directory via:
ls -l /home/raphael/flutter/
If not, while being in the folder mentioned above, try to change permission on the folder via:
chown -R YOUR_USERNAME flutter
Run the first command again to verify that the apropriate user is now shown on the folder. Then try to create the project again.
Try resolving issues one by one. First resolve xcode issue using
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
After this
run
sudo gem install cocoapods
===
If this not works give output of following commands. Also can you tell if brew is installed?
$ruby -v
===
$ which ruby
===
I found that I had to first update gem itself:
sudo gem update --system
Then uninstall and reinstall Cocoapods:
sudo gem uninstall cocoapods
sudo gem install cocoapods
Only then would flutter doctor stop complaining that cocoapods was not installed.

rbenv not able to install ruby 2.2.5 and 2.3.1

I run brew update and brew upgrade rbenv ruby-build. FYI: I updated xcode to version 8.1 yesterday.
I checked available versions, rbenv install -l.
Then I tried to install ruby2.2.5 by rbenv install 2.2.5, then I get the following errors.
I tried 2.3.1 but I got the same errors. How can I fix the problem?
Downloading ruby-2.2.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.5.tar.bz2
Installing ruby-2.2.5...
BUILD FAILED (OS X 10.11.6 using ruby-build 20160602)
Inspect or clean up the working tree at /var/folders/2p/49l6q0gs6qzgtxbg4h1st_5h0000gq/T/ruby-build.20161106122840.51330
Results logged to /var/folders/2p/49l6q0gs6qzgtxbg4h1st_5h0000gq/T/ruby-build.20161106122840.51330.log
Last 10 log lines:
Referenced from: /private/var/folders/2p/49l6q0gs6qzgtxbg4h1st_5h0000gq/T/ruby-build.20161106122840.51330/ruby-2.2.5/./miniruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _clock_gettime
Referenced from: /private/var/folders/2p/49l6q0gs6qzgtxbg4h1st_5h0000gq/T/ruby-build.20161106122840.51330/ruby-2.2.5/./miniruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
make: *** [encdb.h] Trace/BPT trap: 5
make: *** Waiting for unfinished jobs....
make: *** [.rbconfig.time] Trace/BPT trap: 5
First, I've uninstalled all:
brew uninstall rbenv ruby-build
and because of an old sticky ruby-build installation, I've forced like this:
brew uninstall --force ruby-build
I can see an old invocation for rbenv when I type ruby -v. So I remove all rbenv references from $HOME/.bash_profile and then reload it with:
source $HOME/.bash_profile
Now I only see my old default MacOs ruby version:
ruby -v # ruby 2.0.0p481 (2014-05-08 revision 45883)
which ruby # /usr/bin/ruby
¡Good! Now it's time to install them again and then list available Ruby versions:
brew install rbenv
rbenv install -l
I now can see more Ruby options to install...
2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0
I will choose one of them and make it global:
rbenv install 2.5.0
rbenv global 2.5.0
I case you don't have already the $HOME/.bash_profile rbenv config line, run:
rbenv init
... and add the resulting line to your $HOME/.bash_profile.
I tried to upgrade rbenv.
brew upgrade rbenv
Then I got a warning.
Warning: You have Xcode 8 installed without the CLT;
this causes certain builds to fail on OS X El Capitan (10.11).
Please install the CLT via:
sudo xcode-select --install
Error: rbenv 1.0.0 already installed
So I installed xcode-select.
sudo xcode-select --install
Then I tried to upgrade rbenv but rbenv 1.0.0 was already installed.
brew upgrade rbenv
Error: rbenv 1.0.0 already installed
So I tried to install 2.3.1 and 2.2.5
rbenv install 2.3.1
...
rbenv install 2.2.5
And it was a success.
➜ ~ rbenv versions
system
1.9.3-p327
* 2.2.2 (set by /Users/sokada/.rbenv/version)
2.2.5
2.3.1
I also need to install bundle since I came to this problem from using bundle.
gem install bundler -v 1.13.6 // newest as of this writing
bundler -v
bundler install // finally I could use it.
It's a really old question. However, the correct approach I believe is to upgrade ruby-build. It is available as a plugin for rbenv that provides the rbenv install command.
so to fix the issue follow this approach: https://github.com/rbenv/ruby-build#upgrading
# Via Homebrew
$ brew update && brew upgrade ruby-build

Can install cocoapods 1.1.0.rc.2 correctly

I am trying to install the cocoapods beta version 1.1.0.rc.2 because one of the pods i use needs this version. I did the following:
localhost:d.b.g. Melder DBG_MacAB$ mkdir -p §HOME/Software/ruby
localhost:d.b.g. Melder DBG_MacAB$ export GEM_HOME=§HOME/Software/ruby
localhost:d.b.g. Melder DBG_MacAB$ gem install cocoapods --pre
Fetching: cocoapods-1.1.0.rc.2.gem (100%)
Successfully installed cocoapods-1.1.0.rc.2
Parsing documentation for cocoapods-1.1.0.rc.2
Installing ri documentation for cocoapods-1.1.0.rc.2
1 gem installed
localhost:d.b.g. Melder DBG_MacAB$ export
PATH=$PATH:$HOME/Software/ruby/bin
After the seemingly successful install i checked the version and got this.
localhost:d.b.g. Melder DBG_MacAB$ pod --version
1.0.1
This is what i get from pod env.
CocoaPods : 1.0.1
Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
RubyGems : 2.4.8
Host : Mac OS X 10.11.6 (15G1004)
Xcode : 8.0 (8A218a)
Git : git version 2.8.4 (Apple Git-73)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git # bfe37dea873630a4c6be6e71567f7a405a7853e5
After suggested from a member of the cocoapods github site i tried.
localhost:d.b.g. Melder DBG_MacAB$ pod _1.1.0.rc.2_ --version
1.1.0.rc.2
So something seems to be fishy. Can someone point me in the right direction? Maybe i have to delete cocoapods and reinstall it, is there a way to do that via the terminal?
Solved my issue, i had more than one version of cocoapods installed, three versions in fact. I used gem list --local | grep cocoapods in the terminal to see all of them. Then i proceeded to uninstall everything and after reinstalling i had the pod version i wanted.

Can't upgrade cocoapods from 1.0.0 to 1.0.1

$ gem update cocoapods
Updating installed gems
Nothing to update
$ pod --version
1.0.0
==========================================
$ gem install cocoapods
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
Done installing documentation for cocoapods after 3 seconds
1 gem installed
$ pod --version
1.0.0
How can I upgrade to 1.0.1?
=======
I think the problem is I installed two cocoapods via sudo gem install cocoapods and gem install cocoapods
So I remove all of them and install again, the version is correct now.
You can upgrade cocoapods by run following cmd:
upgrade to the latest version by running gem update cocoapods
upgrade to spec version by running gem install cocoapods -v 1.0.1

Resources