when i install AFNetworking using CocoaPods i get following error when i hit "$ pod install" command - objective-c

when i install AFNetworking using CocoaPods i get following error when I hit
$ pod install command
error is
"YOU NEED AT LEAST GIT VERSION 1.8.5 TO USE COCOAPODS"

You have to right now this command in terminal
sudo xcode-select --switch /Applications/Xcode.app

Check git version by executing in terminal:
git --version
You can update/install git from here:
https://git-scm.com/download/mac

You have to download git version from here and Install it
https://git-scm.com/download/mac

It seems that you are facing this problem because your git version is older.
If you have installed Xcode (Xcode has the latest git built-in ), so you only need the terminal type:
sudo Xcode - select - switch/Applications /[your Xcode application name.app]
so that you can use the Xcode built-in git

Related

brew install httpd return error MacOS 10.14 version

Im running this command
brew install php#8.0
Unfortunately i got this error
==> Installing php#8.0 dependency: httpd
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 11.3.1.
==> ./configure --enable-layout=Slackware-FHS --prefix=/usr/local/Cellar/httpd/2
==> make
==> make install
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.
Is there any possible solution to handle it without upgrading MacOS version?

double-quoted include, expected angle-bracketed instead

I've got a React Native App that is built by fastlane via Gitlab that is giving the following error:
.......node_modules/react-native/ReactCommon/yoga/yoga/YGEnums.h:10:10: double-quoted include "YGMacros.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#include "YGMacros.h"
Found this article:
https://developer.apple.com/forums/thread/651941
.gitlab-ci.yml has the following script to build the IOS app.
script:
- rm -rf node_modules
- nvm use
- npm install
- cd ios
- rm -rf ~/Library/Developer/Xcode/DerivedData/*
- rm -rf ~/Library/Caches/CocoaPods/
- sudo gem install bundler:1.17.2
- sudo bundle update
- sudo gem install cocoapods --pre
- bundle exec fastlane beta
It appears the cocoapods install gets the correct version:
$ sudo gem install cocoapods --pre
Successfully installed cocoapods-1.10.0.rc.1
Parsing documentation for cocoapods-1.10.0.rc.1
I'm still getting the double-quotes error
Fixed by putting this in the Gemfile in ios folder:
gem 'cocoapods', '1.10.0.rc.1'
Thanks #PaulBeusterien for the hint.
Find pods, open buildsettings
Search for quoted include,
Set this attribute to No

How do I change the version of yarn used?

I used Homebrew to install yarn. Running yarn -v shows that I currently use 0.23.2. I ran brew upgrade yarn to get the latest version, which is 0.24.6.
After Homebrew successfully upgrades yarn, I run yarn -v again, but the version is still 0.23.2. How can I change the version of yarn that I am running?
yarn policies set-version <version number>
Per https://github.com/yarnpkg/yarn/issues/7146#issuecomment-477809216
You can use homebrew and yarn formula URLs to install older versions of yarn, then brew switch between yarn versions as needed. Works perfectly! Credit to github user robertmorgan.
First off, if you already have a version installed, unlink it from brew running the brew unlink yarn command in your terminal.
Next, in a web browser, find the Pull Request that has been merged which contained the formula (version) of
Yarn
that you want to install.
View the files changed in that Pull Request - there should be one for Formula/yarn.rb.
Click the "View" button for the Formula/yarn.rb file to see the whole contents of the file for that commit.
Click the button to view the "Raw" version of that file. This will open a url which should start with
https://raw.githubusercontent.com/....
This is the URL that you will need for the next step - so copy the complete URL to your clipboard.
Back in your terminal window, use the command brew install followed by the URL that you've copied.
e.g. to install v1.6.0 of yarn it would be:
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/fba7635ab69384ac980c635483a7af825bc06088/Formula/yarn.rb
You can then verify the versions available to Homebrew by running:
brew list --versions yarn, and switch between versions using brew switch yarn VERSION_NUMBER
Source: https://github.com/yarnpkg/yarn/issues/1882#issuecomment-421372892
I found an answer. It's not the prettiest, but since yarn always tell me what the most update-to-date version is, I can use npm to just install the latest version.
If the latest is 0.24.6
npm install --global yarn#.24.6
EDIT:
According to yarn's official documentation, the way to install/upgrade is:
brew install yarn
brew upgrade yarn
https://yarnpkg.com/en/docs/install#mac-stable
Your best bet would be to use a yarn version manager.
Install:
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.sh | bash
Single usage:
yvm exec <version> <command>
Or to switch your currently running yarn version
yvm use <version>
yarn --version
UPDATE Dec 2021:
Sadly brew switch is deprecated in Homebrew 2.6.0 (December 2020)
$ brew switch
Error: Unknown command: switch
TLDR, to switch version:
brew unlink yarn
brew link yarn#<new_version>
Old solution:
Assuming that you have the other version installed, you can run
brew switch yarn <old_version>
To list the versions you have installed:
brew list --versions yarn
You can use
yarn set version <version>
For example, if you want the latest version, you can run
yarn set version latest
You can also set it to a specific number, for example,
yarn set version 1.22.1
You can view the full documentation at the official website.
Note 1: A bug stops you from switching from yarn 2 to yarn 1. There are solutions to this in this GitHub issue.
Note 2: I don't use brew, but this solution should still work.
Easily install and switch between any number of yarn versions.
https://github.com/tophat/yvm
Here's a way to do it with only curl and bash:
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.24.6 # or another version
This works whether you have yarn installed or not.
For updating version on macOS use below command:
$ brew upgrade yarn
Some of the above answers don't seem to work anymore. Here is how I was able to install a different version in April 2021:
brew unlink yarn#1.6.0 (If you already have a version installed)
brew extract --version 1.22.4 yarn homebrew/cask
brew install yarn#1.22.4
yarn -v

Cannot install cocoapods 0.29

I successfully install cocoapods 0.29, and after attempting to run pod setup, it claims I must install 0.29.
Can someone please explain this to me??
Successfully installed cocoapods-0.29.0
Parsing documentation for cocoapods-0.29.0
1 gem installed
bash-3.2$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 -
Update CocoaPods, or checkout the appropriate tag in the repo.
UPDATE:
After updating cocoapods, I am able to run pod setup, however still getting some error about 0.29 not being installed: (And also, when running pod --version, it says I'm on 0.22.3???)
bash-3.2$ sudo gem update cocoapods
Updating installed gems
Nothing to update
bash-3.2$ sudo pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
bash-3.2$ pod install
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 -
Update CocoaPods, or checkout the appropriate tag in the repo.
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide/command.rb:210:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
bash-3.2$ pod --version
0.22.3
navigate this file and delete it
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide
then open ur terminal add this
sudo gem update
its worked for me 100%
Based on your comment
$ type -a pod
pod is /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
pod is /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod
pod is /usr/bin/pod
it appears you have multiple installations of Cocoapods: one with gem install cocoapods in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod and another with sudo gem install cocoapods in /usr/bin/pod (I don't know what /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod is).
So running gem install cocoapods should fix the problem by updating the install in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod.
I'd recommend cleaning up your install though by removing either the global (with sudo) one or the local (without sudo) one.
EDIT:
Here's my Jenkins install:
Installed Cocoapods with gem install cocoapods.
Running type -a pod yield:
$ type -a pod
pod is /Users/Shared/Jenkins/Home/gems/bin/pod
In the Jenkins global config, I added the following environment variables:
GEM_HOME = $JENKINS_HOME/gems
GEM_PATH = $JENKINS_HOME/gems:/usr/lib/ruby/gems/1.8/
PATH = $PATH:$HOME/gems/bin
I added a "Shell script" build step to each project with:
POD_PROJECT_DIRECTORY='MyProject' # Directory where the Podfile is. Probably the same as Xcode plugin's "Xcode Project Directory".
cd "$WORKSPACE/$POD_PROJECT_DIRECTORY"
# rm -rf ./Pods # Uncomment this line if you want to re-download all the Pods each time
pod install --no-color
I found the mismatch of version reported by 'pod --version' and what I was seeing when I updated to be mystifying. Then I realized I had more than one ruby installed on my machine. I changed my $PATH so that the ruby I needed to use came first (e.g. /usr/local/opt/ruby/bin):
In a new shell I found that 'pod --version' started reporting the '0.29.0' version I wanted.

getting a could not resolve host error when trying to install RVM on osx lion

I have all the prereq's installed.. I am on osx lion 10.7.2
xcode:
$ xcodebuild -version
Xcode 4.2.1
git:
$ git --version
git version 1.7.5.4
when i run
$ bash < <( curl -s https://rvm.beginrescueend.com/install/rvm )
i get the following error:
curl: (6) Could not resolve host: HD; nodename nor servname provided,
or not known Could not download
'https://github.com/wayneeseguin/rvm/tarball/master'.
any ideas why? If i run as sudo it goes through but then i get more errors... Need this to install as single user. path to my home dir is:
'/volumes/Macintosh HD/users/mikedevita'
It seems like the file brew is referring to has moved, hence you are looking for a dead link.
I got past this issue by running 'brew update' in the terminal.
After letting this run, and after brew updates to the latest version it should have the latest directories and files, and as a result should avoid dead links. You should be free to continue as normal now.