Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install a cocoapod in mavericks with ruby and Command Line Tools correctly?

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?

like image 960
marciokoko Avatar asked Jan 11 '23 12:01

marciokoko


1 Answers

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.

like image 132
Sheharyar Avatar answered Jan 17 '23 15:01

Sheharyar