xcode8 swift2.3でRealmSwiftを使う際にpod installで下記エラーがでた

最近xcodeをxcode8にして、色々かわりすぎて戸惑いを隠せない、
小心者筆者です。。

いままでxcode7.3かな?で動かしていたRealm Swiftが使えなくなったのでメモ。
前提として、xcode8でswift2.3を使った場合です。

Podfileで下記のようにrealmをインストールしていたのですが


pod 'RealmSwift'

pod install するとっこのようなエラー


$ pod install /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /Applications/Cocos/tools/ant/bin in PATH, mode 040777 Analyzing dependencies Pre-downloading: `RealmSwift` from `https://github.com/realm/realm-cocoa.git`, branch `master`, submodules `true` [!] Unable to satisfy the following requirements: - `Realm (= 2.0.2)` required by `RealmSwift (2.0.2)` None of your spec sources contain a spec satisfying the dependency: `Realm (= 2.0.2)`. You have either: * out-of-date source repos which you can update with `pod repo update`. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile. Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

で、下記で解決


pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'master', :submodules => true pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'master', :submodules => true

はいそれだけ。っす

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください