简体   繁体   中英

Install MagicalRecord using cocoa pods

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM