Help us understand the problem. What is going on with this article?

CocoaPodsのインストールについてのメモ

More than 3 years have passed since last update.

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をインストールできました。

shinog
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした