Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get to work CocoaPods and Yosemite

I already tried this steps:

  1. Open Xcode 6 Open Preferences
  2. Click the Locations tab
  3. Change the Command Line Tools version to Xcode 6.0
  4. Uninstall cocoapods
  5. a. $sudo gem uninstall cocoapods Install xcodeproj
  6. a. $ sudo gem install
  7. xcodeproj Install cocoapods
  8. a. $ sudo gem install cocoapods
  9. Run pod --version to verify that it worked

But I'm still gettings this when I do pod install or pod --version:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.rb:2:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'
like image 617
user3241911 Avatar asked Aug 06 '14 15:08

user3241911


4 Answers

In case someone else got the same issue, I did this to fix my issue:

  1. Update Gems

    sudo gem update --system

  2. Uninstalled xcodeproj

    sudo gem uninstall xcodeproj

  3. Make sure to select All versions

  4. Uninstalled Cocoapods

    sudo gem uninstall cocoapods

  5. Install xcodeproj

    sudo gem install xcodeproj

  6. Install cocoapods

    sudo gem install cocoapods

  7. Run

    pod --version to test.

like image 131
user3241911 Avatar answered Nov 04 '22 17:11

user3241911


Running these 2 lines will resolve your problem

sudo gem update --system

sudo gem install cocoapods

like image 43
Marc Avatar answered Nov 04 '22 18:11

Marc


I had to uninstall the entire dependency chain for cocoapods to get it to work.

for i in `gem list --no-versions`; do gem uninstall -aIx $i; done

see Uninstall all installed gems, in OSX?

like image 2
JoeLaws Avatar answered Nov 04 '22 17:11

JoeLaws


Many of this issues are because of system-wide ruby installation and it forces developers to use "sudo" all the time (well, how many times we did "sudo gem install cocoapods --pre"). I recently had the same issue trying to install a pre-released version of cocoapods (permissions were messed up). So here is a approached that worked for me.

$ sudo gem uninstall xcodeproj 
$ sudo gem uninstall cocoapods

# Let's restore Apple's ruby installation, the following is for Yosemite that has 2.0 ruby by default 
$ cd /System/Library/Frameworks/Ruby.framework/Versions
$ sudo rm Current
$ sudo ln -s 2.0 Current 
$ brew install ruby

(closing and opening terminal window sometimes help)

$ which ruby

should display /usr/local/bin/ruby (should point to "local" directory now, not to "/usr/bin", if this is not the case for you, make sure to modify path order)

Now you should be able to install xcodeproj and cocoapods without using "sudo":

$ gem install xcodeproj --pre
$ gem install cocoapods --pre

(I'm using pre-released version, just remove --pre if you want to use releases instead).

Enjoy :)

like image 2
interrupt Avatar answered Nov 04 '22 16:11

interrupt