<code class="hljs http has-numbering"><span class="hljs-attribute" style="color: rgb(163, 21, 21);"></span></code>ERROR: Error installing cocoapods:activesupport requires Ruby version >= 2.2.2.
说明Ruby环境需要升级更新, 我以mac OS 10.11.5 更新ruby方法为例, 更新Ruby环境安装cocoapods的详细步骤:
终端成功安装cocoapods详细步骤:
Last login: Thu Jul 14 08:57:44 on console
TuFa-Mac:~ TuFa$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
TuFa-Mac:~ TuFa$ gem sources --remove https://rubygems.org/
source https://rubygems.org/ not present in cache
TuFa-Mac:~ TuFa$ gem sources -a https://ruby.taobao.org/
source https://ruby.taobao.org/ already present in the cache
TuFa-Mac:~ TuFa$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
TuFa-Mac:~ TuFa$ sudo gem install cocoapods
Password:
ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.
TuFa-Mac:~ TuFa$ curl -L get.rvm.io | bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Couldn't connect to server
TuFa-Mac:~ TuFa$ ping
usage: ping [-AaDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize]
[-g sweepminsize] [-h sweepincrsize] [-i wait] [−k trafficclass]
[-l preload] [-M mask | time] [-m ttl] [-p pattern]
[-S src_addr] [-s packetsize] [-t timeout][-W waittime] [-z tos]
host
ping [-AaDdfLnoQqRrv] [-b boundif] [-c count] [-I iface] [-i wait]
[−k trafficclass] [-l preload] [-M mask | time] [-m ttl] [-p pattern] [-S src_addr]
[-s packetsize] [-T ttl] [-t timeout] [-W waittime]
[-z tos] mcast-group
TuFa-Mac:~ TuFa$ 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 148 0 0:00:01 0:00:01 --:--:-- 148
100 22865 100 22865 0 0 2919 0 0:00:07 0:00:07 --:--:-- 5645
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.
Upgrading the RVM installation in /Users/apple/.rvm/
RVM PATH line found in /Users/apple/.mkshrc /Users/apple/.profile /Users/apple/.bashrc /Users/apple/.zshrc.
RVM sourcing line found in /Users/apple/.profile /Users/apple/.bash_profile /Users/apple/.zlogin.
Upgrade of RVM in /Users/apple/.rvm/ is complete.
# tf1106285167,
#
# 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
Upgrade Notes:
* No new notes to display.
TuFa-Mac:~ TuFa$ source ~/.bashrc
TuFa-Mac:~ TuFa$ source ~/.bash_profile
TuFa-Mac:~ TuFa$ source ~/.profile
TuFa-Mac:~ TuFa$ rvm -v
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
TuFa-Mac:~ TuFa$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
TuFa-Mac:~ TuFa$ 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-<name> --url https://github.
TuFa-Mac:~ TuFa$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
TuFa-Mac:~ TuFa$ gem sources --remove https://rubygems.org/
source https://rubygems.org/ not present in cache
TuFa-Mac:~ TuFa$ gem sources -a https://ruby.taobao.org/
source https://ruby.taobao.org/ already present in the cache
TuFa-Mac:~ TuFa$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
TuFa-Mac:~ TuFa$ sudo gem install cocoapods
Password:
ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.
TuFa-Mac:~ TuFa$ curl -L get.rvm.io | bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Couldn't connect to server
TuFa-Mac:~ TuFa$ ping
usage: ping [-AaDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize]
[-g sweepminsize] [-h sweepincrsize] [-i wait] [−k trafficclass]
[-l preload] [-M mask | time] [-m ttl] [-p pattern]
[-S src_addr] [-s packetsize] [-t timeout][-W waittime] [-z tos]
host
ping [-AaDdfLnoQqRrv] [-b boundif] [-c count] [-I iface] [-i wait]
[−k trafficclass] [-l preload] [-M mask | time] [-m ttl] [-p pattern] [-S src_addr]
[-s packetsize] [-T ttl] [-t timeout] [-W waittime]
[-z tos] mcast-group
TuFa-Mac:~ TuFa$ 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 148 0 0:00:01 0:00:01 --:--:-- 148
100 22865 100 22865 0 0 2919 0 0:00:07 0:00:07 --:--:-- 5645
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.
Upgrading the RVM installation in /Users/apple/.rvm/
RVM PATH line found in /Users/apple/.mkshrc /Users/apple/.profile /Users/apple/.bashrc /Users/apple/.zshrc.
RVM sourcing line found in /Users/apple/.profile /Users/apple/.bash_profile /Users/apple/.zlogin.
Upgrade of RVM in /Users/apple/.rvm/ is complete.
# tf1106285167,
#
# 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
Upgrade Notes:
* No new notes to display.
TuFa-Mac:~ TuFa$ source ~/.bashrc
TuFa-Mac:~ TuFa$ source ~/.bash_profile
TuFa-Mac:~ TuFa$ source ~/.profile
TuFa-Mac:~ TuFa$ rvm -v
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
TuFa-Mac:~ TuFa$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
TuFa-Mac:~ TuFa$ 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-<name> --url https://github.