使用可可豆荚安装MagicalRecord

时间:2015-02-07 16:44:10

标签: ios cocoapods magicalrecord

我希望这对大多数人来说都是一年级,但我试图通过CocoaPods安装MagicalRecord,这是我第一次使用Cocoa Pods和Terminal。

我已经更新了Ruby Gems并且已经安装了Cocoa Pods,并且已经(在终端中)导航到我项目的根文件夹(我是否正确地假设这是包含相关项目的文件夹?)。我在Github的说明中说:


在项目中集成MagicalRecord的最简单方法是使用CocoaPods:

将以下行添加到您的Podfile:

pod" MagicalRecord"

在项目目录中,运行pod update

您现在应该可以将#import添加到任何目标的源文件中,并开始使用MagicalRecord!


直接问题:我不知道我的Podfile可能是什么,也不知道。此外,在某些时候,我以为我看到了Cocoa Pods"环境的提及,"所以我甚至不肯,我还应该留在终点站。 Cocoa Pods有自己的用户界面吗?

请帮忙!

修改

感谢Ckouta的指导,我取得了一些进展。然而,这就是终端现在向我展示的,我不确定我是否成功:

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$ 

有人可以确认吗?

1 个答案:

答案 0 :(得分:1)

使用可可豆荚非常简单,您可以在website找到所有内容。首先,这是要做的步骤:

在项目目录中创建一个Podfile(只是一个没有扩展名的文件),里面有以下文字:

platform :ios, '8.0'
pod "MagicalRecord"

准备好Podfile后,使用终端或使用Xcode plugin

在项目目录中运行pod install

有关详细信息,请查看CocoaPods guides,您会找到很多信息。