(1)sudo gem install cocoapods

Fetching: i18n-0.7.0.gem (100%)

Successfully installed i18n-0.7.0

Fetching: thread_safe-0.3.5.gem (100%)

Successfully installed thread_safe-0.3.5

Fetching: tzinfo-1.2.2.gem (100%)

Successfully installed tzinfo-1.2.2

Fetching: minitest-5.9.0.gem (100%)

Successfully installed minitest-5.9.0

Fetching: concurrent-ruby-1.0.2.gem (100%)

Successfully installed concurrent-ruby-1.0.2

Fetching: activesupport-5.0.0.gem (100%)

ERROR:  Error installing cocoapods:

activesupport requires Ruby version >= 2.2.2.

//ruby的版本号过低

(2)ruby -v

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

//的确是版本号太低了

(3)curl -L get.rvm.io | bash -s stable

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100   184  100   184    0     0    206      0 --:--:-- --:--:-- --:--:--   209

100 22865  100 22865    0     0  11431      0  0:00:02  0:00:02 --:--:--  187k

Downloading https://github.com/rvm/rvm/archive/1.27.0.tar.gz

Downloading https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc

Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc',

but no GPG software exists to validate it, skipping.

Installing RVM to /Users/zzh/.rvm/

Adding rvm PATH line to /Users/baidu/.profile /Users/baidu/.mkshrc /Users/baidu/.bashrc /Users/baidu/.zshrc.

Adding rvm loading line to /Users/baidu/.profile /Users/baidu/.bash_profile /Users/baidu/.zlogin.

Installation of RVM in /Users/zzh/.rvm/ is almost complete:

* To start using RVM you need to run `source /Users/baidu/.rvm/scripts/rvm`

in all your open shell windows, in rare cases you need to reopen all shell windows.

# zzz,

#

#   Thank you for using RVM!

#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!

#

# ~Wayne, Michal & team.

In case of problems: https://rvm.io/help and https://twitter.com/rvm_io

 
(4)接着执行以下三条命令:

zzh:~ zzh$ source ~/.bashrc

zzh:~ zzh$ source ~/.bash_profile

zzh~ zzh$ rvm -v

rvm 1.27.0 (latest) by Wayne E. Seguin , Michal Papis [https://rvm.io/]

zzh:~ zzh$ ruby -v

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

(5)开始用rvm安装ruby

zzh:~ zzh$ rvm list known

# MRI Rubies

[ruby-]1.8.6[-p420]

[ruby-]1.8.7[-head] # security released on head

[ruby-]1.9.1[-p431]

[ruby-]1.9.2[-p330]

[ruby-]1.9.3[-p551]

[ruby-]2.0.0[-p648]

[ruby-]2.1[.8]

[ruby-]2.2[.4]

[ruby-]2.3[.0]

[ruby-]2.2-head

ruby-head

# for forks use: rvm install ruby-head- --url https://github.com/github/ruby.git --branch 2.2

# JRuby

jruby-1.6[.8]

jruby-1.7[.23]

jruby[-9.0.5.0]

jruby-head

# Rubinius

rbx-1[.4.3]

rbx-2.3[.0]

rbx-2.4[.1]

rbx[-2.5.8]

rbx-head

# Opal

opal

# Minimalistic ruby implementation - ISO 30170:2012

mruby[-head]

# Ruby Enterprise Edition

ree-1.8.6

ree[-1.8.7][-2012.02]

# GoRuby

goruby

# Topaz

topaz

# MagLev

maglev[-head]

maglev-1.0.0

# Mac OS X Snow Leopard Or Newer

macruby-0.10

macruby-0.11

macruby[-0.12]

macruby-nightly

macruby-head

# IronRuby

ironruby[-1.1.3]

ironruby-head

(6)选择一个版本号开始安装,选最新的2.3

zzh:~ zzh$ rvm install 2.3

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.

Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

Checking requirements for osx.

Installing requirements for osx.

Updating system.......

Error running 'requirements_osx_brew_update_system ruby-2.3.0',

showing last 15 lines of /Users/baidu/.rvm/log/1470726560_ruby-2.3.0/update_system.log

https://github.com/Homebrew/homebrew/wiki/Common-Issues

and make sure `brew update` works before continuing.'

++ rvm_pretty_print stderr

++ case "${rvm_pretty_print_flag:=auto}" in

++ case "${TERM:-dumb}" in

++ case "$1" in

++ [[ -t 2 ]]

++ return 1

++ printf %b 'Failed to update Homebrew, follow instructions here:

https://github.com/Homebrew/homebrew/wiki/Common-Issues

and make sure `brew update` works before continuing.\n'

Failed to update Homebrew, follow instructions here:

https://github.com/Homebrew/homebrew/wiki/Common-Issues

and make sure `brew update` works before continuing.

++ return 1

Requirements installation failed with status: 1.

//结果出错了,打开/Users/baidu/.rvm/log/1470726560_ruby-2.3.0/update_system.log文件,好像是brew没有升级

(7)升级brew

zhangzhihui:~ baidu$ brew update

To restore the stashed changes to /usr/local/Library/Taps/homebrew/homebrew-core run:

'cd /usr/local/Library/Taps/homebrew/homebrew-core && git stash pop'

Updated 1 tap (homebrew/core).

==> New Formulae

alot              convox            genext2fs         hyper             libvterm          mimetic          osc               presto            tbox              wireguard-tools

b2sum             digdag            git-remote-hg     lego              livestreamer      minio            osm-gps-map       rancher-cli       todolist

==> Updated Formulae

abcm2ps                       dateutils                     glibmm                        libdap                       ntl                           scour

abduco                        datomic                       glide                         libdrawtext                  ntopng                        sdb

abi-compliance-checker        davmail                       glyr                          libebml                      nuxeo                         sec

==> Renamed Formulae

commonmark -> cmark

==> Deleted Formulae

avidemux              gimp                  kdiff3                luyten                osxfuse              shrewsoft-vpn-client  swatchbooker

(8)再次安装ruby 2.3

zzh:~ zzh$ rvm install 2.3

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.

Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

Checking requirements for osx.

Installing requirements for osx.

Updating system.....

Installing required packages: automake...

Error running 'requirements_osx_brew_libs_install automake',

showing last 15 lines of /Users/zzh/.rvm/log/1470726877_ruby-2.3.0/package_install_automake.log

++ case "$1" in

++ [[ -t 1 ]]

++ return 1

++ printf %b 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'

There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation

++ case "$_system_version" in

++ return 1

Requirements installation failed with status: 1.

//还是有问题

(9)打开/Users/zzh/.rvm/log/1470726877_ruby-2.3.0/package_install_automake.log文件,发现是automake和autoconf虽然安装了,但是没有链接上。如下面所示:

zzh:~ zzh$ brew install autoconf

Warning: autoconf-2.69 already installed, it's just not linked

zzh:~ zzh$ brew install automake

Warning: automake-1.15 already installed, it's just not linked

//只是没有连接,只要重新链接就可以了,如下:

zzh:~ zzh$ brew link --overwrite autoconf

Linking /usr/local/Cellar/autoconf/2.69... 60 symlinks created

Warning: autoconf-2.69 already installed

zzh:~ zzh$ brew link --overwrite automake

Linking /usr/local/Cellar/automake/1.15... 124 symlinks created

(10)重新安装ruby 2.3

zzh:~ zzh$ rvm install 2.3

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.

Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

Checking requirements for osx.

==> Upgrading 1 outdated package, with result:

pkg-config 0.29.1_1

==> Upgrading pkg-config

==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.1_1.el_capitan.bottle.tar.gz

######################################################################## 100.0%

==> Pouring pkg-config-0.29.1_1.el_capitan.bottle.tar.gz

mac安装CocoaPods遇到的问题及解决办法的更多相关文章

  1. Mac本软件安装之后打不开的解决办法

    Mac本软件安装之后打不开的解决办法 MacOS系统版本10.15.3 一,安装Axure RP 9 问题:安装之后打不开 提示“Axure RP 9已损坏,无法打开”或“打不开 Axure RP 9 ...

  2. Mac打开应用提示已损坏的解决办法

    相信很多升级了最新Mac系统的用户在打开一些应用的时候都会出现“应用XX已损坏”的系统提示,安装这些应用的时候总是提示“已损坏,移至废纸篓”这类信息,根本无法打开应用. Mac打开应用提示已损坏的解决 ...

  3. hadoop安装遇到的各种异常及解决办法

    hadoop安装遇到的各种异常及解决办法 异常一: 2014-03-13 11:10:23,665 INFO org.apache.hadoop.ipc.Client: Retrying connec ...

  4. .NET4安装总进度一直不动的解决办法

    在安装.NET4时遇到上面的进度在动,而安装进度一直停在0,解决办法: 禁止并关闭Window Update服务,重新运行安装程序. 关闭服务:控制面板->管理工具->服务->Win ...

  5. Mac 不显示未知来源选项的解决办法/连接不上网络

    原文来自百度经验: http://jingyan.baidu.com/article/eae078278b37d41fec5485b2.html 灰常感谢原作 关于mac无法连接wifi,我的解决办法 ...

  6. Mac 外接 Dell 4K 显示器字体模糊解决办法

    Mac 外接 Dell 4K 显示器字体模糊解决办法 mac mini mbp 2020 refs https://zhuanlan.zhihu.com/p/52100804 xgqfrms 2012 ...

  7. 安装JavaJDK没有jre环境的解决办法 错误: C:\Program Files\Java\jdk-11.0.7\jre

    安装JDK11 发先没有jre解决办法 在安装目录下执行 bin\jlink.exe --module-path jmods --add-modules java.desktop --output j ...

  8. mac上Navicat新建数据库3680错误解决办法

    mac上Navicat新建数据库3680错误解决办法 1.在设置里关闭mysql,若不能关闭,在终端输入: sudo /usr/local/mysql/support-files/mysql.serv ...

  9. 最新Mac安装CocoaPods详细教程及各种坑解决办法

    网上有很多教程,但要么内容很老,要么不详细,要么各种坑的情况没写.最近买新电脑了,正好要走一遍这些流程,所以写下次教程. 一.安装RVM及更新Ruby 安装RVM的目的是为了更新Ruby,如果你的Ru ...

随机推荐

  1. Linux高可靠技术

    1.进程挂死时,有后台监控程序检测重新拉起. 2.进程占用系统资源超过ulimit限定的资源时,会被ulimit杀死,同时配合后台监控程序,重新拉起进程,实现进程可靠性. 3.Linux系统的高可靠性 ...

  2. 【转】MySQL:日期函数、时间函数总结(MySQL 5.X)

    转自:http://www.cnblogs.com/she27/articles/1377089.html 一.MySQL 获得当前日期时间 函数1.1 获得当前日期+时间(date + time)函 ...

  3. android.support不统一的问题

    今天supprt28遇到的问题,由于28还是预览版,还存在一些bug 都是因为如果程序内出现不同的,support或者其他外部引用库的多个版本,Gradle在进行合并的时候会使用本地持有的,最高版本的 ...

  4. (网页)JS中的小技巧,但十分的实用!

    转自CSDN: 1.document.write(”"); 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:document->html->(head,body)4. ...

  5. Scrapy爬取遇到的一点点问题

    学了大概一个月Scrapy,自己写了些东东,遇到很多问题,这几天心情也不大好,小媳妇人也不舒服,休假了,自己研究了很久,有些眉目了 利用scrapy 框架爬取慕课网的一些信息 步骤一:新建项目 scr ...

  6. Dos命令讲解

    目录 一.什么是DOS 二.启动DOS的多种方法 三.DOS的内部命令与外部命令 四.系统环境变量讲解 增加Path环境变量路径 常见的系统环境变量 五.常用的运行命令 六.DOS使用技巧 设置CMD ...

  7. js,ajax,layer笔记(弹出层,在弹出一个弹框)

    整体认识: 因为作用域的问题,js 在页面初次加载时已近加载好了,所以要有第二次弹窗的效果,必须得在第一次成功之后再次让他加载js 代码: /*shaun*/showdetailsPag: funct ...

  8. The Art of Unit Testing With Examples in .NET

    The Art of Unit Testing With Examples in .NET

  9. Vs .Net Framework 灵活配置

    背景:我们开发和部署项目时都是通过注释某些配置项 比如: 在调试时就注释掉生产的配置项,在生产时又要改回来,只有一个还好,如果多的话就会非常容易出错. 问题1:在发布时容易出错,需要控制发布时根据配置 ...

  10. ping 127.0.0.1和ping本地ip分别测试什么?

    ping 127.0.0.1 是你本地的回环地址! 实际上只要是127.0.0.1到127.255.255.255都是回环地址!都是可以PING检查的! 它能ping通,说明你的TCP/IP协议栈没问 ...