http://qiita.com/satoken0417/items/479bcdf91cff2634ffb1
において、
sudo gem install cocoapods
でつまづく。以下エラー文。
ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.
以下のように、rbenvのバージョンを >= 2.2.2.になるようにしたが効果無し。
kimuraryouyuu-no-MacBook-Air:~ Ryosuke$ rbenv versions
system
2.2.0
* 2.2.3 (set by /Users/Ryosuke/.rbenv/version)
よくよく調べてみると、gemにおけるRUBY VERSIONが2.0.0であった。(もはやgemとrbenvの違いがわかってない汗)
kimuraryouyuu-no-MacBook-Air:~ Ryosuke$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.6
- RUBY VERSION: 2.0.0 (2014-05-08 patchlevel 481) [universal.x86_64-darwin13]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
- USER INSTALLATION DIRECTORY: /Users/Ryosuke/.gem/ruby/2.0.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- SPEC CACHE DIRECTORY: /Users/Ryosuke/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-13
- GEM PATHS:
- /Library/Ruby/Gems/2.0.0
- /Users/Ryosuke/.gem/ruby/2.0.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/Ryosuke/anaconda/bin
- /Library/Frameworks/Python.framework/Versions/3.5/bin
- /Users/Ryosuke/Library/Enthought/Canopy_64bit/User/bin
- /Library/Frameworks/Python.framework/Versions/2.7/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/bin
- /opt/X11/bin
- /usr/local/git/bin
RUBY VERSIONを上げる方法がわからなかったので、
シンプルに「ERROR: Error installing cocoapods: activesupport requires Ruby version >= 2.2.2.」と検索してみると
https://github.com/CocoaPods/CocoaPods/issues/4711
が見つかり、
sudo gem install activesupport -v 4.2.6
をして無事にcocoapodsをインストールできました。