IOS about Cocoapods Installation

Source: Internet
Author: User

There are still a lot of apps for Cocoapods in iOS because we need to use some of the better third parties. So about the installation of cocoapods, here I am also jiehuaxianfo, from others to get the installation method. In fact, for the installation, there are many ways on the internet, my and other people's also no difference, but I am here with a small white point of view to some considerations

1, installation is to use the terminal many people are probably not very likely to use the terminal, in fact, the following command is copied, and then pasted into the terminal can be

2, to note that must be step-by-step, each step after the end of the word "$" will appear before the next step to continue

Install cocoapods 1. Remove Ruby's source address gem sources--remove https://rubygems.org/ 2. Add Ruby's Source Address gem sources-a/HTTP Ruby.taobao.org/ 3. View Ruby's source address gem sources-l 4. Installing the Cocoapodssudo gem install cocoapods//Note: sudo for admin rights, So you need to enter a password, enter the password when the cursor does not prompt//CD access to the file//ls view the current folder in the file//pwd get the current file path//cocoapods requires a minimum version of Ruby 1.9.3, if necessary upgrade needs to review the following Ruby upgrade  5. If you are prompted that the gem version is too low, you need to upgrade the Gemsudo Gem update--system 6. Test Cocoapods Installation Success Pod search afnetworking//Comment: afnetworking is the name of a third party , can be replaced by other, and support fuzzy search//If not installed successfully, prompt setting up CocoaPods Master Repo//cocoapods installation has two steps: a.cocoapods environment installation B.cocoapods The main branch is created (equivalent to checkout a copy from the Cocoapods server to your computer)  7. Remove cocoapods main pod repo remove master 8. Modify Cocoapods address pod repo add master https://gitcafe.com/akuandev/Specs.git//where https://gitcafe.com/akuandev/Specs.git can also be http://git.oschina.net/akuandev/Specs.gitpod repo add master http://git.oschina.net/akuandev/ Specs.git9. Update cocoapods Main branch pod repo update   after installation We also test whether we can use 1. or in the terminal step by step 2 in the Save this step   Save the Podfile file, and exit (press ESC to save exit) For example: Wq (First press ESC then press:   then press W and then press Q before proceeding to the next step)   use cocoapods 1. To create a project  2. On the command line CD project home directory for example: cd/users/fuxiaohui/desktop/ Lessoncocoapods 3. Creating a file named Podfile for example: Vim podfile 4. To write the third-party class library you want to add in Podfile, you can use pod search * To search for the third-party library you're looking for. For example: Pod ' Jsonkit ', ' ~> 1.5pre '  5. Save the Podfile file and exit (save exit after pressing ESC) for example: Wq 6. Installing a third-party class library for example: Pod install  or: (recently may be due to the problem of the overseas node, whether it is the implementation of Pod install or pod update card in analyzing dependencies not move, slow to the point of extreme, unbearable.   In fact, the reason is that the above two command execution will upgrade Cocoapods's Spec warehouse, plus a parameter can omit this step, and then the speed will be improved a lot. The commands for adding parameters are as follows:  pod install--verbose--no-repo-update  or  pod update--verbose--no-repo-update)    7.from now on use ' lessoncocoapods.xcworkspace '. Open *.xcworkspace,//Note Be sure to turn off the previous project    upgrade ruby 1. installation [ Xcode] (http://developer.apple.com/xcode/) development tool that will help you install the development package  2 that your Unix environment requires. installation [Homebrew] For example: Ruby-e "$ (curl-fssl Https://raw.githubusercontent.com/Homebrew/install/master/install) " 3. Installation RVM For example: Curl-l Https://get.rvm.io | Bash-s stable 4. Loading RVM Environment For example: source ~/.rvm/scripTs/rvm 5. Check if the installation is correct for example: rvm-v 6. Installation RVM For example: RVM install 2.0.0 7. Set Ruby version For example: RVM 2.0.0--default    Be patient and do it slowly. Once you've done something wrong, do it again  

IOS about Cocoapods installation

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.