0

I expect this is first grade for most of you guys, but I'm trying to install MagicalRecord via CocoaPods and it's my first time using Cocoa Pods AND Terminal.

I've gotten past having updated Ruby Gems and have installed Cocoa Pods itself, and have navigated (in Terminal) to the root folder of my project (do I assume correctly that this is the folder containing the project in question?). I'm at the point where the instructions on Github say:


The easiest way to integrate MagicalRecord in your project is to use CocoaPods:

Add the following line to your Podfile:

pod "MagicalRecord"

In your project directory, run pod update

You should now be able to add #import to any of your target's source files and begin using MagicalRecord!


Immediate problem(s): I don't know what nor where my Podfile might be. Also, at some point, I thought I saw a mention of the Cocoa Pods "environment," so I'm not even positive I should still be in the Terminal. Does Cocoa Pods have its own UI?

Please help!

EDIT

Thanks to Ckouta's guidance, i've made some progress. However, this is what Terminal is showing me now, and I'm not sure if I was successful or not:

Analyzing dependencies
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory - /Users/timjones/.cocoapods/repos (Errno::ENOENT)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `foreach'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `children'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:63:in `all'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:130:in `repo_information'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:34:in `report'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:58:in `report_error'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'
Tim-Jones-MacBook-Pro:xxxxxxx timjones$ 

Can someone confirm?

rattletrap99
  • 1,469
  • 2
  • 17
  • 36
  • For your `pod install` issue , take a look at this post: http://stackoverflow.com/a/27060693/4177109. I think it's the same issue – tbaranes Feb 07 '15 at 18:15
  • This seemed to work just fine! Many thanks for your time, amigo! You get a check and an up vote! – rattletrap99 Feb 07 '15 at 18:30

1 Answers1

1

Using cocoa pods is very easy, you can find everything on their website. To start with it, these is the steps to do:

Create a Podfile (just a file without extension) in your project directory with the following text inside:

platform :ios, '8.0'
pod "MagicalRecord"

Once your Podfile ready, run pod install in your project directory using the terminal or using the Xcode plugin

For more information take a look at the CocoaPods guides, you will find a lot information.

tbaranes
  • 3,560
  • 1
  • 23
  • 31
  • OK, I've created a file named "Podfile" and checked to be sure it's actually there. Putting the text inside poses the next challenge. I've seen several different commands (sed, echo). Is there a preference? Also, this is the first time I've seen reference to "platform :ios, '8.0'". You sure this is correct? – rattletrap99 Feb 07 '15 at 17:32
  • In fact, you can even use your text editor or Xcode to create your Podfile and put the text inside. The only thing important is to be sure your Podfile is in your project directory. You can use the terminal only to run the command. About the platform, you have to set your target version, I don't think it's mandatory, but better to have it in order to have your pods well configured – tbaranes Feb 07 '15 at 17:37
  • Ah, ok, I was just wondering about using a text editor. I'll report back. – rattletrap99 Feb 07 '15 at 17:46
  • OK, the pod file now has "pod "MagicalRecord" in it. Next, you say "You can use the terminal only to run the command." Please be explicit. Does this mean I should type the words "pod install" into the terminal window? I ask this because the MagicalRecord page says to use "pod update." Can you tell me for sure which is correct. I know I sound pretty stupid, but, well, I am. :) – rattletrap99 Feb 07 '15 at 17:55
  • In fact, "pod install" and "pod update" will give you the same result. The main difference is `pod install` will only install the new pods in your Podfile, whereas `pod update` will install the latest version for each pod. And yes, it means you have to run the command in the terminal window, or using a Xcode plugin, it's up to you! – tbaranes Feb 07 '15 at 18:02
  • Thanks very much for your help. I used "install" and here is what terminal printed out: (see edit, not enough room here) – rattletrap99 Feb 07 '15 at 18:05