Mac OS 10.12系统cocoapods安装

从git上下载的项目运行后:The file “Pods.xcconfig” couldn’t be opened because there is no such file.linux

一、检查当前ruby版本git

$gem sources -github

成功后提示:xcode

*** CURRENT SOURCES ***ruby

https://ruby.taobao.org/bash

不然,移除现有的ruby:$gem sources --remove https://rubygems.org/;添加使用淘宝镜像:$gem sources -a https://ruby.taobao.org/curl

二、开始安装cocoapodside

$sudo gem install cocoapodsui

运行后出现错误url

2.1检查ruby版本

$ruby -v

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

2.2须要升级ruby;

    查看目前全部ruby版本:$rvm list known 若是提示command not found

    $curl -L get.rvm.io | bash -s stable

    请先安装rvm:rvm install 2.2.2 ;若是不成功,检查homebrew卸载安装

    卸载:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!

 解决问题:删除原来的安装目录

rm -rf Cellar Frameworks Homebrew

从新执行安装:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

运行后有下边提醒,则出现安装成功:

==> Installation successful!

 在执行:$ rvm install 2.2.2

    运行结果:

Please be aware that you just installed a ruby that requires        1 patches just to be compiled on an up to date linux system.

This may have known and unaccounted for security vulnerabilities.

Please consider upgrading to ruby-2.3.0 which will have all of the latest security patches.

Ruby was built without documentation, to build it run: rvm docs generate-ri成功

以后就开始安装cocoapods:$sudo gem install cocoapods

结果:

Installing ri documentation for cocoapods-1.0.1

Done installing documentation for nap, fourflusher, escape, colored, concurrent-ruby, thread_safe, tzinfo, i18n, activesupport, claide, xcodeproj, molinillo, cocoapods-try, netrc, cocoapods-trunk, cocoapods-stats, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, fuzzy_match, cocoapods-core, cocoapods after 146 seconds

23 gems installed

则安装成功 》

 

谨记:运行pod install时老是卡在Setting up CocoaPods master repo,由于这条命令被墙了,换成pod install --verbose --no-repo-update

pod update --- > pod update --verbose --no-repo-update

相关文章
相关标签/搜索