cocoapods在OS X 10.11.6 安装记录

我的用的是ruby-china的源 gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

开始安装:

sudo gem install -n /usr/local/bin cocoapods 

然后告诉我 ruby的版本必须 >=2.2.2 当前版本为 ruby 2.0.0p648

安装ruby一般都是通过rbnv或rvm来安装,但是要按这俩必须安装homebrew ,接下来安装brew

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


It appears Homebrew is already installed. If your intent is to reinstall you

should do the following before running this installer again:

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

The current contents of /usr/local are .git .github .gitignore

根据提示尝试删除brew重新安装

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

删除失败,没有访问这些目录的权限

The following possible Homebrew files were not deleted:

/usr/local/.DS_Store

/usr/local/.git/

/usr/local/.github/

You may consider to remove them by yourself.

You may want to restore /usr/local's original permissions

sudo chmod 0755 /usr/local

sudo chown root:wheel /usr/local

再三尝试无果,只好手动删除这三个目录

irondeMacBook-Pro:~ IRON$ sudo rm -rf /usr/local/.DS_Store

irondeMacBook-Pro:~ IRON$ sudo rm -rf /usr/local/.git

irondeMacBook-Pro:~ IRON$ sudo rm -rf /usr/local/.github

之后安装成功

cocoapods在OS X 10.11.6 安装记录_第1张图片

按照ruby-chain的教程  如何快速正确的安装 Ruby, Rails 运行环境

接下来,安装这三个东西

brew install libxml2 

brew install libxslt

brew install homebrew/dupes/libiconv

然后

$gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

$\curl -sSL https://get.rvm.io | bash -s stable

$source~/.bashrc

$source~/.bash_profile


检查一下 rvm -v ,成功。

接下来,用rvm,安装ruby

rvm requirements

rvm install 2.3.0

rvm use 2.3.0 --default

进行检测

ruby -v

gem -v

安装 Bundler  

 gem install bundler

安装rails

gem install rails 

测试 rails -v


接上续,pod setup仍然有问题出现

cocoapods在OS X 10.11.6 安装记录_第2张图片

这个错误应该是是网络原因

修改git的默认postBuffer即可  git config --global http.postBuffer 24288000


你可能感兴趣的:(cocoapods在OS X 10.11.6 安装记录)