OSX :Making CocoaPods compatible with older version install - ios

I installed CocoaPods (cocoapods-0.37.2) but I need to make sure is backward­-compatible with version 0.35.0. My question for you is how can I do that?
Here is how installed:
sudo gem install cocoapods
I'll really appreciate your help

Since you install CocoaPods through rubygems you can use their infrastructure for this. In this case installing an old version is described here. Once you install an old version you'll have both the newer and older installed. This means when you run pod it will pick the new one. If you don't want to uninstall 0.37.2 then you'll have to specify which you want to use. That process is described here

Related

Flutter upgrade cocapods version

I'm trying to update my cocoapods version used by flutter. I already upgraded cocoapods by running sudo gem install cocoapods.
When I run pod --version anywhere in the terminal it returns version 1.10.1 but when I run it inside my flutter ios project (path myProject/ios) it returns version 1.9.3 and also flutter doctor tells me that cocoapods is using version 1.9.3.
I also tried running brew update and brew upgrade cocoapods as well as brew link --overwrite cocoapods.
Can anybody tell me how to align the version used inside my flutter project with the globally (?) installed cocoapods version?
After trying all of the commands in the question I also ran sudo gem update --system in my projects\ios folder which finally solved the problem.

How do I lock down a version of CocoaPods for a project?

How do I lock down the version of CocoaPods used to install pods in a project? I see plenty of discussion on locking down the pod dependencies, but not the version of CocoaPods used to install those dependencies.
This would mitigate the problem of Podfile.lock changing when each developer on a project uses a different version of CocoaPods.
Most of the time we simply update the cocoapods to latest version.
If you got some reasons for keeping the version, you might go with rvm + bundler + cocoapods approach.
install rvm and set ruby version
install bundler to the ruby ver.
create and share a Gemfile to your team in project folder
source 'https://rubygems.org'
gem 'cocoapods', '~> 1.9.3'
gem 'fastlane'
install it
bundle install

Trying to install rails, but I get the error "i386 architecture is deprecated on macOS."

The full text of the error
The most important line, to my untrained eye, seems to be: ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
But am I really supposed to modify the Xcode build settings?
I am trying $ sudo gem install rails.
My specs:
macOS High Sierra 10.13.6
Xcode version: 10.0 (10A255)
Ruby version: 2.3.7p456
Gem version: 2.7.8
Recommendations I've found so far:
1) Install xcode command line tools. They are installed.
2) bundle config build.nokogiri --use-system-libraries.
/\ I've read that I should not do this.
Any help would be greatly appreciated!
As #anothermh mentioned, you shouldn't use system ruby. I'd mention further that you don't want to, and shouldn't need to, run sudo to install gems.
Use a ruby version manager such as asdf (my recommended), rvm (probably one of the most popular), or rbenv (also a solid choice).
I'd also recommend, if you haven't done it already, that you grab homebrew because you'll need a few dependencies. Highly recommend at least:
brew install gcc libxml2 readline
I've tried to bundle install and had issue like this. In my case upgrading rails from 4.2.5. to 4.2.9 fixed error. Maybe it will help someone to not lose time.

How to switch between versions of cocoapods?

Is there a way to switch between versions of cocoapods?
This is what I get when I try to remove one:
Select gem to uninstall:
1. cocoapods-0.29.0
2. cocoapods-0.34.4
3. cocoapods-0.35.0
4. cocoapods-0.36.0
5. cocoapods-0.37.2
6. cocoapods-0.38.2
7. cocoapods-0.39.0
8. All versions
I just select the number of one I need to uninstall. Is there a way to set current version of cocoapods?
Install specific version with this command example,
sudo gem install cocoapods -v 0.36.0
Or uninstall all the version , so it will be good if only latest version is available.
check this . how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
and install cocoapod again with sudo gem install cocoapods command.
Check here :- How to install coocapod
To get some previous version of cocoapods use this:
sudo gem install -n /usr/local/bin cocoapods -v 1.4.0
Why using -n flag? Read this!
To install pods using 1.4.0 use this:
pod _1.4.0_ install

How to use a specific version of CocoaPods

Is it possible to somehow specific the version of CocoaPods I'd like to use when upgrading or installing a Podfile? I've encountered several times where Podfiles work correctly with one version of CocoaPods but not with others.
For example, the syntax I'm looking for is like the following:
pod -v 0.34 install
Since CocoaPods is installed through RubyGems you can use their mechanisms for doing this. As outlined here you can do this:
pod _0.34.0_ install
You can verify this is working with:
pod _0.34.0_ --version
Also I would highly advise against doing this at all. I would definitely recommend you keep CocoaPods up to date and change your Podfile as needed to adapt to new versions. At anytime your old version could stop working as expected if we bump the minimum version number.
the ultimate solution:
run a bash script to completely uninstall your current verison (Optinal)
for i in $( gem list --local --no-version | grep cocoapods ); do
sudo gem uninstall $i;
done
sudo gem uninstall xcodeproj
install a specific verison of CocoaPod
gem install cocoapods -v 0.39.0

Resources