LoginSignup
3
2

More than 5 years have passed since last update.

cocoapods インストール

Posted at

cocoapods をサクッとインストールしようと思ったら、
なんだかんだと設定が必要だったので備忘録

$ sudo -E gem install cocoapods
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)

sudoすると元のユーザの環境変数が引き継がれず、Proxyの設定が無になっているそうです。Proxyの環境変数を引き継ぐようにしてみた

$sudo visudo

最終行に以下を追記してみた

Default   env_keep += "http_proxy https_proxy"

タイムアウトはしなくなったんだが。。。

$ sudo gem install cocoapods
Password:
ERROR:  Error installing cocoapods:
    activesupport requires Ruby version >= 2.2.2.

これは、gemのactivesupportがRubyは2.2.2を要求しているってことか。。

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14.1
  - RUBY VERSION: 2.0.0 (2015-12-16 patchlevel 648) [universal.x86_64-darwin15]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-15
  - GEM PATHS:
     - /Library/Ruby/Gems/2.0.0
     - /Users/hijiri/.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/

今はRUBY VERSIONが2.0.0か。。
どうやらactivesupport をインストールすれば良いらしい

 sudo gem install activesupport -v 4.2.6
Password:
Fetching: activesupport-4.2.6.gem (100%)
Successfully installed activesupport-4.2.6
Parsing documentation for activesupport-4.2.6
unable to convert "\x84" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping
Installing ri documentation for activesupport-4.2.6
1 gem installed

これでOKか?!

sudo gem install cocoapods

いけた!
ひとまず備忘録ってことで。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2