简体   繁体   English

无法与cocoapods一起安装RealmSwift

[英]Can not install RealmSwift with cocoapods

Every time I am trying to install RealmSwift with cocoapods gives me [!] /bin/bash -c set -e sh build.sh cocoapods-setup error. 每次我尝试使用cocoapods安装RealmSwift时,都会给我[!] /bin/bash -c set -e sh build.sh cocoapods-setup错误。 I have updated to xcode 8 and cocoapods to 1.1.0 however when I try from another mac with older cocoa RealmSwift 1.0.2 is getting installed. 我已经更新到xcode 8,可可粉已更新到1.1.0,但是当我从另一台使用较旧可可粉的Mac尝试安装RealmSwift 1.0.2时。

Please help 请帮忙

Open terminal and hit this command 打开终端并点击此命令

$ [sudo] gem install cocoapods

It will simply update CocoaPods version of your system. 它将仅更新系统的CocoaPods版本。 And then try to install Realm using this. 然后尝试使用此安装Realm。

Add this piece of code to pods file, 将这段代码添加到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

It will add Realm for your latest swift version. 它将为您的最新快速版本添加Realm。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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