4

This is my setup:

Mavericks 10.9.1 Xcode 5.0.2 which ruby returns this:

/Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 

but dvm install ruby returns:

Already installed ruby-2.1.0. To reinstall use: rvm reinstall ruby-2.1.0 

So doesn't this mean I have ruby 2.1.0?

gems list says I have installed cocoa pods & cocoapods-core 0.29.0 and some other gems.

After sudo gem install cocoa pods I get the bunch of fetches and change log and Successfully Installed cocoa pods 0.29.0. It then parses and installs documentation and when I run pod setup I got:

Setting up CocoaPods master repo Setup completed (read-only access) 

So I created a file from a tutorial:

platform :iOS, '7.0' pod 'Mantle' pod 'TSMessages' pod 'ReactiveCocoa' 

but when I run pod install I get:

/Users/myusername/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'cocoa pods' (>= 0) among 37 total gem(s) (Gem::LoadError) from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec' from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem' from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/pod:22:in `<main>' 

How do I get the pod to install correctly and why am i getting messages of ruby 1.9.3?

4
  • Looks like you need to use something like rvm use and specify the version to your 2.1 version. Commented Jan 8, 2014 at 3:18
  • Ok I did dvm --default 2.1.0 and now which ruby says /Users/quique123/.rvm/rubies/ruby-2.1.0/bin/ruby ...Thx! Commented Jan 8, 2014 at 3:26
  • 1
    Yes I solved it. I had to update my ruby as in this post: quique123.wordpress.com/2014/01/15/… Commented Feb 3, 2014 at 21:29
  • correct command is sudo gem install cocoapods Commented Dec 16, 2017 at 13:55

1 Answer 1

9

If you have rvm installed do not use sudo gem install cocoapods. It creates problems. Follow these steps to fix your cocoapods installation:

  1. Uninstall Cocoapods:

    sudo gem uninstall cocoapods 
  2. Make sure you're on the latest Ruby:

    which ruby 
  3. Install cocoapods without sudo:

    gem install cocoapods -V --no-ri --no-rdoc # V: Verbose; no-ri,no-rdoc: Do not install documentation 
  4. Set up Cocoapods:

    pod setup 

Should work now.

Sign up to request clarification or add additional context in comments.

2 Comments

gives error installing: You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
This solution is for users who have rvm installed (Ruby Version Manager)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.