- 之前曾发表过一篇关于CocoaPods安装的问题http://www.jianshu.com/p/9c209bcb475b
如今发现出现了好多问题。 - 我查了一下,找到了解决办法,给大家分享一下
- Ruby版本更新不了
- 安装过程中出现如下提示
ERROR: Error installing cocoa: activesupport requires Ruby version >= 2.2.2.
- 1.安装 RVM baby 版本管理器
$ curl -L get.rvm.io | bash -s stable
打印代码:
In case of problems: https://rvm.io/help and https://twitter.com/rvm_io - 2.测试
$ source ~/.bashrc
$ source ~/.bash_profile
- 3.查看版本
rvm -v
- 4.用RVM升级Ruby
列出已知的ruby版本
$ rvm list known
安装ruby 2.2.2
$ rvm install 2.2.2
Searching forbinary 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.
About to install Homebrew, press `Enter` for defaultinstallation in `/usr/local`,
.
.
.
.
Password:
==> /usr/bin/sudo /usr/sbin/chown boai /usr/local/.
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/.
==> /usr/bin/sudo /bin/mkdir /Users/boai/Library/Caches/Homebrew
.
.
.
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: pkg-config, libyaml, readline, libksba, openssl
**这里可能会等很久,不要慌。。。**
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.2.2 - #configure
ruby-2.2.2 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6854k 100 6854k 0 0 37933 0 0:03:05 0:03:05 --:--:-- 47983
ruby-2.2.2 - #validate archive
ruby-2.2.2 - #extract
ruby-2.2.2 - #validate binary
ruby-2.2.2 - #setup
ruby-2.2.2 - #gemset created /Users/hskj/.rvm/gems/ruby-2.2.2@global
ruby-2.2.2 - #importing gemset /Users/hskj/.rvm/gemsets/global.gems............-
ruby-2.2.2 - #generating global wrappers........
ruby-2.2.2 - #gemset created /Users/hskj/.rvm/gems/ruby-2.2.2
ruby-2.2.2 - #importing gemsetfile /Users/hskj/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.2 - #generating default wrappers........
Updating certificates in '/etc/openssl/cert.pem'.
mkdir: /etc/openssl: Permission denied
mkdir -p "/etc/openssl" failed, retrying with sudo
ailover password required for 'mkdir -p /etc/openssl':
and sudo mkdir worked
现在就可以查看版本了
$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
是不是很高兴、、
接下来就可以安装CocoPods喽、
补充下安装CocoPods出现的问题
- 添加完镜像后
- 出现
[!] To setup the master specs repo, please run pod setup
- 我的解决办法,重新打开窗口
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
- 完成以后·
pod setup
- 多等一会(不要慌),应该就OK了。