ios - 无法使用 cocoapods 安装 RealmSwift

标签 ios cocoa realm swift3

每次我尝试用 cocoapods 安装 RealmSwift 时都会给我 [!]/bin/bash -c 设置-e sh build.sh cocoapods-setup 错误。我已经更新到 xcode 8 和 cocoapods 到 1.1.0 然而,当我尝试从另一台装有较旧 cocoa 的 Mac 时,RealmSwift 1.0.2 正在安装。

请帮忙

最佳答案

打开终端,输入命令

$ [sudo] gem install cocoapods

它只会更新您系统的 CocoaPods 版本。然后尝试使用它安装 Realm。

将这段代码添加到pods文件中,

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '2.3' # or '3.0'
    end
  end
end

它将为您最新的 swift 版本添加 Realm。

关于ios - 无法使用 cocoapods 安装 RealmSwift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39703730/

相关文章:

ios - becomeFirstResponder 在 iOS 11 中不显示键盘

objective-c - 为什么 NSApplescriptexecuteAndReturnError : seem to leak memory?

objective-c - iOS MapKit 用户定位而不初始化 map

ios - `indexOf` 抛出 "Object type does not match RLMResults"异常

realm - 在 Realm Object Server 上的用户之间共享数据的最佳策略?

iOS swift : UIViewControllerAnimatedTransitioning end frame in wrong position

ios - 使用 RxSwift 注册两个自定义单元格

swift - 我可以使用自定义 View 作为 NSSplitView 的分隔线吗?

android - 如何从动态字段名更新 Realm 值

ios - 快速处理选择器参数