enKay enKay - 4 months ago 28
Ruby Question

Error during install cocoapods

I am trying to install the latest CocoaPods (which is currently 1.0.1) but it shows me the following error.

$ sudo gem install cocoapods
Password:
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.9.0.gem (100%)
Successfully installed minitest-5.9.0
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: activesupport-5.0.0.gem (100%)
ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.


The installation guide says


[...] it will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing.


ruby is not my preferred language, so can anybody help me, how i can install the cocoapods gem?

OSX Version: OS X El Capitan 10.11.5

Answer

First install an old version of 'activesupport' (which is both compatible with ruby 2.0 and with cocoapods) and then install cocoapods. sudo gem install activesupport -v 4.2.6