22

I am trying to add a pod to my Xcode project. I am getting this error:

LoadError - no such file to load -- xcodeproj/prebuilt/universal-darwin13.0-1.8.7/xcodeproj_ext /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in gem_original_require' /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in require' /Library/Ruby/Gems/1.8/gems/xcodeproj-0.14.0/lib/xcodeproj/ext.rb:6 /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in gem_original_require' /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in require' /Library/Ruby/Gems/1.8/gems/xcodeproj-0.14.0/lib/xcodeproj/project.rb:4 /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:488:in compute_target_platforms' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:485:in each' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:485:in compute_target_platforms' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:55:in analyze' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:171:in analyze' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:94:in resolve_dependencies' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/user_interface.rb:52:in section' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:93:in resolve_dependencies' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:86:in install!' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/command/project.rb:38:in run_install_with_update' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/command/project.rb:68:in run' /Library/Ruby/Gems/1.8/gems/claide-0.3.2/lib/claide/command.rb:206:in run' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/command.rb:51:in run' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/bin/pod:19 /usr/bin/pod:23:in load' /usr/bin/pod:23

My podfile contents:

pod 'RestKit', '~> 0.21.0'

Any help would be appreciated!

user2885928
  • 323
  • 1
  • 6
  • 13

6 Answers6

19

I also was seeing this. Running this fixed the issue:

sudo gem install cocoapods && pod install
Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
Jack Rowlingson
  • 325
  • 2
  • 9
  • 3
    for me it didn't fix the issue :( I just upgraded our build server to mavericks and now Jenkins shows this error when building and installing cocoapods again didn't fix it – Vik Nov 28 '13 at 16:10
4

Finally found a solution: I'm running old Xcode4 and new Xcode5 in same machine with same projects. At some point I seem to have lost command line tools (and iPhone5 simulator).

Reinstalling command line tools solved the problem for me. Since Xcode 4.6.3 menu item Xcode - Preferences - Downloads - Components didn't have command-line tools any more for unknown reasons, here is another way to install them:

xcode-select --install

--install
          Opens a user interface dialog to request automatic installation of the
          command line developer tools.

Now running "pod install" worked just fine.

JOM
  • 8,139
  • 6
  • 78
  • 111
3

if you are using 10.10 and are seeing this error (/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:) try this

Open Xcode 6 > Preferences > Locations
Command Line Tools version to Xcode 6.0
Uninstall cocoapods/xcodeproj then re-install.

sudo gem uninstall cocoapods
sudo gem uninstall xcodeproj
sudo gem install xcodeproj
sudo gem install cocoapods

pod --version 
johndpope
  • 5,035
  • 2
  • 41
  • 43
0

As follow, this my problem: /usr/local/Cellar/ruby/2.5.0_2/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- Xcodeproj (LoadError)

from /usr/local/Cellar/ruby/2.5.0_2/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'

from Script/ModuleDiscover.rb:9:in `'

Just attempt many method, and it is no use , finnaly I resolve the problem just bellow:

1、command + q,exit xcode

2、open terminal and "open -a xcode". all fine

sunshine
  • 81
  • 1
  • 6
0

Files added in the pods but their reference is not considered until you run the command pod install. Just runt the bellow command:

pod install

Umair Ali
  • 758
  • 8
  • 17
0

For the M1 mac, please install CocoaPods from Homebrew as installing CocoaPods from gem doesn't seem to work. Visit brew.sh for more information.

brew install cocoapods

Vraj Shah
  • 536
  • 2
  • 7
  • 19