9

This was working fine and then suddenly it wasn't. I wish i knew why. Really stuck and cannot find anything online. I'm working on an ObjectiveC project. I've tried reseting everything with:

$ sudo gem uninstall ruby
$ sudo gem uninstall cocoapods

then

$ sudo gem install ruby
$ sudo gem install cocoapods
$ sudo gem update ruby
$ sudo gem update cocoapods

then i when in my projects directory i run

$pod install 

and get the following error. I get this on all projects.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- cocoapods-core (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:8:in `<module:Pod>'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:4:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:23:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

Any ideas/clues/answers would be very appreciated.

Mordred
  • 3,734
  • 3
  • 36
  • 55

3 Answers3

17

I reinstalled cocoa pods by running

$ sudo gem uninstall cocoapods-core cocoapods-downloader cocoapods
$ sudo gem install cocoapods

That resolved the issue for me

der_michael
  • 3,151
  • 1
  • 24
  • 43
2

Looks like you're missing one of CocoaPod's dependencies. You should be able to install it with:

[sudo] gem install cocoapods-core
Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
1

You should stop using "sudo" for tasks such as "gem install" etc. Here is a little tutorial on how to fix your ruby to ensure that you are not going to see issues with permissions for cocoapods (and other gems):

Can't get to work CocoaPods and Yosemite

Community
  • 1
  • 1
interrupt
  • 2,030
  • 17
  • 14