我已下载此邮件https://github.com/Loadex/MessageBanner,但无法正确安装以运行。所有应用程序都显示自定义iOS横幅。我希望有可口豆经验的人让这个应用程序在本地运行并从下载过程解释,他们在一个很好的紧凑答案中做了什么。我想逐步解释如何让它运行。谢谢。到目前为止,我已经尝试了这个但是在终端和Xcode运行时发出大量警告之后删除了项目文件夹。我安装了可可豆荚。
WTL2:~ Apple$ cd desktop
WTL2:desktop Apple$ cd m
WTL2:m Apple$ cd MessageBannerDemo
WTL2:MessageBannerDemo Apple$ touch podfile
WTL2:MessageBannerDemo Apple$ pod install
Analyzing dependencies
CocoaPods 0.36.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Downloading dependencies
Generating Pods project
Integrating client project
[!] From now on use `MessageBannerDemo.xcworkspace`.
[!] [!] The Podfile does not contain any dependencies.
WTL2:MessageBannerDemo Apple$
还将此添加到podfile
source 'git@github.com:CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'MessageBanner', '~> 1.0'
答案 0 :(得分:3)
如果你还没有更新ruby gem而没有安装cocoa pod,那么请按照“setup to use cocoa pods”进行操作,之后再“运行项目”。如果您已经安装了cocoapod,那么您可以选择“A”选项。但建议遵循'A',然后'B'。
:一种。设置使用可可豆荚
打开终端并按照以下步骤
- 更新ruby gem
醇>
“sudo gem update —system”
请求时输入系统密码。等到它完成。 这可能需要很少的时间 成功安装后,您将看到类似的内容。
Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.
RubyGems system software updated
- 安装cocoapods
醇>
“sudo gem install cocoapods”
你可以得到这个覆盖按,只需输入Y继续。 成功安装后,您将看到与此类似的内容
Installing ri documentation for cocoapods-core-0.36.0
Parsing documentation for cocoapods-0.36.0
Installing ri documentation for cocoapods-0.36.0
20 gems installed
- 完成CocoaPods的设置
醇>
“pod setup”
成功后,你会看到类似的东西。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Setting up CocoaPods master repo
Setup completed
<强> B中。运行下载的项目
打开终端并按照这些步骤
- 转到项目的位置。
醇>
ex cd ~/desktop/myProjects/TestCocoapod
- 告诉cocoapod安装项目的依赖项。
醇>
“pod install”
安装成功后,您会看到类似这样的内容
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `TestCocoapod.xcworkspace` for this project from now on.
3.注意:在此之后打开包含该项目的文件夹。你必须 始终打开.xcworkspace(例如TestCocoapod.xcworkspace)。
4现在运行该项目。你可以成功运行它。
答案 1 :(得分:1)
确保您的Podfile格式正确:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
workspace 'MessageBannerDemo.xcworkspace'
# Make sure xcodeproj is in correct path. Or update path here.
xcodeproj 'MessageBannerDemo/MessageBannerDemo.xcodeproj'
pod 'MessageBanner'
# Specify Xcode project targets to link the default pod with.
link_with 'MessageBannerDemo'
尝试“rm -rf Pods Podfile.lock”然后再次“pod install”。
答案 2 :(得分:0)
像这样更改Podfile并运行pod install:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'MessageBanner'