Install CocoaPods on Mac

Source: Internet
Author: User

Install the SDK by running the ruby gem command on Mac.

To view the ruby version, open the terminal and enter ruby-v.

First download CocoaPods from GitHub

Terminal input command: sudo gem install cocoapods

Enter the computer password as prompted

An error is prompted during initial installation:

ERROR: Error installing cocoapods:

Cocoapods requires cocoapods-core (= 0.31.1, runtime)

Then I upgraded the gem using sudo gem update -- system.

Run the following command again: sudo gem install cocoapods.

Prompt successful

Run the command: pod setup

Prompt Installation Complete

 

 

Use of CocoaPods

 

Run the command: pod search "name of API" to view the version information of the third-party library.

Terminal cd to the folder where the project is located

Run the command: pod init

Create a Podfile

Double-click Podfile and paste the library to be added.

Format: pod "name of API", "~> Version Number"

Save files

Terminal command: pod install

The project generates a file named project name. xcworkspace. You can use this file to open the project later.

 

After the pod, the system cannot find the header file. Although you can write it on your own, it is awkward. I checked the steps on the Internet to set the directory of the header file, in the Target of the project-& amp; gt; build Settings-& amp; gt; user header search paths enter $ {SRCROOT} and select recursive

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.