在没有Xcode项目的情况下将cocoapod添加到Swift Playground

时间:2018-05-19 21:48:57

标签: ios swift cocoapods xcode9 swift-playground

我想在Swift Playground中添加一个cocoapod,但我尝试运行pod init,但我收到此错误:

[!] No Xcode project found, please specify one

我在thread

上尝试了解决方案
  1. gem install cocoapods-playgrounds
  2. pod playgrounds Alamofire
  3. 但是我收到了这个错误:

    Errno::ENOENT - No such file or directory @ dir_initialize - /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source/Playground with Platform Choice.xctemplate
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:43:in `open'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:43:in `foreach'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:43:in `dir_for_platform'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:10:in `initialize'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:26:in `new'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:26:in `block in generate'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:23:in `chdir'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:23:in `generate'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/command/playgrounds.rb:46:in `run'
    /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:22:in `load'
    /usr/local/bin/pod:22:in `<main>'
    

    你们中任何人都知道解决这个错误吗?

0 个答案:

没有答案