Create a Podfile file

Source: Internet
Author: User
Tags documentation install cocoapods

I. Summary

When iOS is developed, many third-party libraries are referenced in the project, and CocoaPods ( can be used to manage these third-party libraries conveniently and uniformly.

Second, installation

As the online tutorials are basically similar, but the details are not very perfect, so the opportunity will be added here:

Note: To use Cocoapods, download and install it, and download and install cocoapods requires a ruby environment

1. Building Ruby Environment

The current installation environment is Mac mini 10.8.5. The Mac OS itself comes with Ruby, but it's still an update, because the first time I installed it failed without updating Ruby.

A view the current Ruby version: Open the terminal input ruby-v (yes, but with this version the next work fails, so update under Ruby)

[OBJC] view plain copy print? Ritekimac-mini:podtest lucky$ ruby-v Ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] RitekiMac-mini:Pod Test lucky$
b Update Ruby

Terminal Enter the following command (point the Ruby image to Taobao, avoid being the wall, you know)

Gem Sources--remove
Gem Sources-a
Gem sources-l (used to check for successful use of alternate mirror locations)

[OBJC] view plain copy print? ritekimac-mini:~ lucky$ gem sources--remove from sources Ritekima c-mini:~ lucky$ gem sources-a to sources ritekimac-mini:~ Luc ky$ Gem SOURCES-L * * * * Current SOURCES * * *

2. Download and install CocoaPods

Terminal input: sudo gem install cocoapods

[HTML]  View plain copy print? ritekimac-mini:~ lucky$ sudo gem install cocoapods      CHANGELOG:       ## 0.32.1      ##### bug fixes       * fixed the podfile  ' Default_subspec '  attribute in nested  subspecs.       [Fabio Pelosin][irrationalfab]    \ [# 2050] (          successfully  installed cocoapods-0.32.1   installing ri documentation for  cocoapods-0.32.1  /system/library/frameworks/ruby.framework/versions/1.8/usr/lib/ruby/1.8/rdoc/ rdoc.rb:280: warning: conflicting chdir during another chdir block   /system/library/frameworks/ruby.framework/versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block   Done installing  documentation for cocoapods after 10 seconds   1 gem  installed  

This will download and install the Cocoapods

3. Using Cocoapods

A Create a new project, name Podtest

b terminal, CD-to-project directory (note: The head record containing the Podtest folder, Podtest.xcodeproj, Podtesttest)

[OBJC] view plain copy Print

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: 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.