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

相關文章
相關標籤/搜索