cocoa pods Installation

本文档详细介绍了如何使用默认的Ruby安装CocoaPods,并提供了无须管理员权限的安装方法。此外还介绍了如何更新CocoaPods以及解决安装过程中遇到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考: http://guides.cocoapods.org/using/getting-started.html#installation
CocoaPods is built with Ruby and it will be installable with the default Ruby available on OS X. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on OS X unless you know what you're doing.

Using the default Ruby install will require you to use sudo when installing gems. (This is only an issue for the duration of the gem installation, though.)

$ sudo gem install cocoapods
If you encounter any problems during installation, please visit this guide.

<Sudo-less installation

If you do not want to grant RubyGems admin privileges for this process, you can tell RubyGems to install into your user directory by passing either the --user-install flag to gem install or by configuring the RubyGems environment. The latter is in our opinion the best solution. To do this, create or edit the .profile file in your home directory and add or amend it to include these lines:

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
Note that if you choose to use the --user-install option, you will still have to configure your .profile file to set the PATH or use the command prepended by the full path. You can find out where a gem is installed with gem which cocoapods. E.g.

$ gem install cocoapods --user-install  用sudo方式安装在Mac OSX 10.11上报错
$ gem which cocoapods
/Users/eloy/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb
$ /Users/eloy/.gem/ruby/2.0.0/bin/pod install
<Updating CocoaPods

To update CocoaPods you simply install the gem again
$ [sudo] gem install cocoapods
Or for a pre-release version
$ [sudo] gem install cocoapods --pre    gem install cocoapods --user-install --pre

升级后在 Link Binary With Libraries 中libPods.a变为了libPods-TargetName.a,需要移除。

转载于:https://www.cnblogs.com/qike/p/5466461.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值