由于安裝cocopds出現(xiàn)的錯誤
Error installing cocoapods:? activesupport requires Ruby version >= 2.2.2.
1疲恢、安裝 RVM baby 版本管理器
$curl -L get.rvm.io | bash -s stable
//________等安裝完成 出現(xiàn)下面這行提示以下___________
In case of problems: https://rvm.io/helpandhttps://twitter.com/rvm_io
執(zhí)行
$source ~/.bashrc
$source ~/.bash_profile
測試是否安裝正常
$rvm -v
//________提示以下___________
rvm 1.27.0 (latest) by Wayne E. Seguin, Michal Papis[https://rvm.io/]
2谤民、用RVM升級Ruby查看當前ruby版本
$ruby -v
$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-headruby-head
# for forks use: rvm install ruby-head---url https://github.com/github/ruby.git --branch 2.2
# JRuby
安裝ruby 2.2.2 執(zhí)行
$rvm install 2.2.2
如果打印:
……? 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/abc/.rvm/gems/ruby-2.2.2@global? ? ruby-2.2.2 - #importing gemset
/Users/abc/.rvm/gemsets/global.gems..............................? ? ruby-2.2.2 - #generating global wrappers........? ? ruby-2.2.2 - #gemset created /Users/abc/.rvm/gems/ruby-2.2.2? ? ruby-2.2.2 - #importing gemsetfile /Users/abc/.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? ? LiuWenqiang password required for 'mkdir -p /etc/openssl':? ? and sudo mkdir worked
則說明安裝成功了
打印代碼:
Done with Command Line Tools (OS X 10.11) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Failed during: /usr/bin/sudo /usr/bin/xcode-select --install
Requirements installation failed with status: 1.