This one was written in Markdown. I cleaned up the layout. Previous articles can no longer be changed to Markdown. Make it work. That’s bullshit. Get water. Go. Get water.

Error caused by basic Cocoapods upgrade version to 1.0.0

Error 1.

When third-party frameworks written in Podfile cannot be used and cannot be found

Check the Pods folder to see if you have downloaded the required third-party frameworks, or pod Update if not

Error 2, Could not automatically select an Xcode project. Specify one in your Podfile like so:xcodeproj ‘the path/to/Project. Xcodeproj’ in Podfile Project in a directory specified in the file

xcodeproj ‘Demo/Demo.xcodeproj’

However, if Cocoapods version is (1.0.0), you may get the following warnings

[!] xcodeproj was renamed to project. Please use that from now on.

All you need to do is change xcodeProj to Project

project ‘Demo/Demo.project’

Mistake 3,

The dependency AFNetworking (~> 3.0) is not used in any concrete target.

Add to Podfile

Target ‘project name ‘do (e.g. target’Demo’ do)

Error 4.

[!] Invalid Podfile file: syntax error, unexpected end-of-input, expecting keyword_end.

Add end to the end of the Podfile

Error 5,

Unable to find the Xcode project /Volumes/BIAO/iOS/code/MBWB.xcodeproj for the target Pods.

Change project’Demo/demo. project’ to project’ demo.project ‘in your Podfile

Error 6,

build diff: /.. /Podfile.lock: No such file or directory

Delete Check Pods Manifest.lock and Copy Pods Resources under Build Phases in project Settings

If pod install or POD Update depends on dependencies, it doesn’t change

The reason for this is that when executing the above two commands, CocoaPods’ spec repository will be updated. Adding a parameter will skip this step and increase the speed considerably. The command to add parameters is as follows:

pod install –verbose –no-repo-update

Pod update –verbose –no-repo-update ### Because cocoapods now requires Ruby >=2.2: ####1. First check to see if Ruby is up to date. Ruby is installed using RVM, so you need to install RVM first to check whether Ruby is up to date (by looking at the List of Ruby versions), and then enter the following command in terminal requirements:

Input -- ruby -v roughly output -- Ruby 2.0.0Copy the code

RVM:Ruby Version Manager, including Ruby Version management and Gem library management (gemset)

curl -L get.rvm.io | bash -sstable``` ! [](http://upload-images.jianshu.io/upload_images/1761100-9766e578269ec49a.png? ImageMogr2 / Auto-orient/Strip % 7CImageView2/2 / W /1240) Install RVM after waiting a while, the RVM will be successfully installedCopy the code

source ~/.bashrc source ~/.bash_profile“`

Test whether the installation is normal

rvm -v``` ! [](http://upload-images.jianshu.io/upload_images/1761100-00020291e1940b59.png? ImageMogr2 / Auto-orient/Strip % 7CImageView2/2 / W /1240) RVM installation is complete#####(2) Upgrade Ruby with RVMRuby is installed using RVM, so you need to install RVM first to check whether Ruby is up to date (by looking at the List of Ruby versions), and then enter the following command in terminal requirements:Copy the code

Ruby -v ruby 2.3.0 ` ` `

###### List known Ruby versions – find the latest version to install RVM List Known

###### Install Ruby 2.3.0 as long as it is greater than 2.2

Requirements installation failed with status: 1. Cause: Homebrew is not installed on Mac. Solution: Enter the following command to install Homebrew or go to the official website to find the latest download link: brew.sh/index_zh-cn… Or ruby – e “$(curl – fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

2 WARNING: ** echo”source ~/.profile”>> ~/.bash_profile** You have ‘~/.profile’ file, You might want to load it

####2. Replace the Ruby image – the image on Taobao (https://ruby.taobao.org/) is no longer available. Official need FQ. So now we use the latest supported Ruby image (https://gems.ruby-china.org/) —-> I use this note: some can use taobao source, also do not report an error, the specific reason is unknown, if no error can continue to use Taobao image. Required command lines:

gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.org/
gem sources -l(Used to check that the replacement mirror position was successfully used)Copy the code

appear

Success. ####3. Download and install CocoaPods. Run the following command to install CocoaPods:

Sudo gem install cocoapods sudo gem install cocoapodsCopy the code

sudo gem install -n /usr/local/bin cocoapods“`

Sudo gem update cocoapods

##### install —- here will be ready soon… The e online tutorial says this is done. But I tried it. I just did a search. Enter pod Search AFNetworking in the terminal. – “Setting up the CocoaPods master repo” will appear, and it does not move for a long time because there is no FQ. But we have already changed the bury mirror, why would it be like this? . The other reason is because it was downloaded in the background, and it hasn’t been downloaded yet, so it happens. I have been waiting here for a long time. Open a new terminal window, enter “CD ~/. Cocoapods /” to go to the cocoapods folder, and run “du -sh *” to check the folder size. It’s always 0. It’s falling apart. Start all over again. First, update Ruby to the latest (above), update gems to the latest, and update Cocoapods to the latest. “Setting up the cocoapods master repo” is always “Setting up the cocoapods master repo” but the size is still 0. And then there’s this new error (which I’m overjoyed with, or at least not so boring, but maybe a breakthrough) : [!] An error occurred while performing git pull on repo master. [!] /usr/bin/git pull –ff-only Try adding a new node to cocoapods by deleting the node from cocoapods: ###### Cause: The branch of Cocoapods does not support the latest Xcode version ###### Sudo rm -fr ~/. Cocoapods /repos/master

Then: Pod Setup

##### Note: according to my experience at this time there are two options #### the first kind of pro test recommended according to CocoaPods installation, super detailed inside the practice, go to Baidu web disk or 360 web disk access password 1EE5 download this master file on the web disk. Once downloaded, just drag it into the Repos folder. Simple and crude

#### second kind: wait for him to download complete in the process of pod setup is this prompt “Setting up CocoaPods master repo”, at that time the feeling is about to hit the computer, finally do not give up to check CocoaPods folder size. Results:. Yeah, that’s right. It’s growing all the time. Wait slowly with excitement.

At ######, the pod setup operation is successful after about ten or twenty minutes. So, the entire cocoapods installation should be successful. I can’t wait to try it out. Type in “POD Search AFNetworking” and something comes up.

#####PS: If pod Search XXXXX is not the latest version, you need to run the CD convert file path command on your terminal to return to your Desktop, then run the pod setup command to update your local spec cache (which may take a few minutes), and then search again.

Create a Single View Application on your desktop. Enter: CD + space, drag the folder you just created to your desktop to your terminal, press Enter to create Podfile, then enter Vim Podfile

Enter I on the keyboard to enter the edit mode and enter:

Press Esc and enter “:” to enter vim command mode. Then enter wq after the colon

Note: you can enter wq only after typing:. Press Enter to find an additional Podfile in the home directory of the PodTest project

Now comes the exciting moment: Make sure terminal CD goes to the project home directory and type Pod Install… And then you’ll find… Note: If you write like this,

platform :ios, '7.0'
pod 'MBProgressHUD'.'~ > 0.8'You may get this error: [!]  The dependency `MBProgressHUD`isnot usedin any concrete target. It turns out that new Cocoapods can't install third parties like before. The current format is to add the target of the project. As follows:Copy the code

Platform: ios, ‘8.0’ use_frameworks! Target ‘MyApp’do pod’ AFNetworking’,’~> 3.0′ pod’SDWebImage’,’~>3.7.6′ end

**MyApp** remember to replace the target in your project **. This is basically OK, pod install/pod update is done. Updating may get stuck when installing a third party library using Pod Installlocal specs repositories
The #### solution is to replace podinstall with podinstall--verbose --no-repo-update! [](http://upload-images.jianshu.io/upload_images/1761100-4bb171046db9cb78.png? ImageMogr2 /auto-orient/strip% 7cImageView2/2 /w/1240) successful end: Finally finished. Summary: If the installation fails, delete and re-(update) all the required environments (Ruby, gem, Cocoapods, including cocoapods nodes) and replace them with new Ruby images. * * / / 9.27 update readers to give advice You can download the latest master reference * * ([https://github.com/CocoaPods/Specs] (https://github.com/CocoaPods/Specs), You can pod Reaserch AFN, but you can't pod install. The solution is to copy the.git folder from the master folder to ~/.cocoapods/. Cocoapods, refer to the installation process: [HTTP: / / http://www.cnblogs.com/guanshenbao/p/5534578.html# undefined] (http://www.cnblogs.com/guanshenbao/p/5534578.html#undefined) ([__ you less] (http://home.cnblogs.com/u/guanshenbao/))More detailed] [CocoaPods installation, (http://www.jianshu.com/p/1bb0ad42cb2e)Copy the code