【问题标题】:EEXIST - File exists workspace/PodsEEXIST - 文件存在工作空间/Pod
【发布时间】:2016-05-30 17:31:02
【问题描述】:

当我尝试通过 Jenkins 构建应用程序时,就会发生这种情况。 我已经清除了 Jenkins 中的当前工作区并构建了应用程序并引发了以下错误

[workspace] $ touch Pods rm -r -f Pods pod repo update
[workspace] $ pod install
[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:

export LANG=en_US.UTF-8
[0m

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

```
/usr/bin/pod install
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 0.37.2
        Ruby : ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
    RubyGems : 2.5.2
        Host : Mac OS X 10.10.3 (14D136)
       Xcode : 6.3.2 (6D2105)
         Git : git version 2.3.2 (Apple Git-55)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ efe0250cfcdd610a45cdd5691bd3c6bcb38669be
```

### Plugins

```
cocoapods-plugins : 0.4.2
cocoapods-trunk   : 0.6.1
cocoapods-try     : 0.4.5
```

### Podfile

```ruby
platform :ios, '7.0'

pod 'AFNetworking', '1.3.2'
pod 'FMDB', '~> 2.3'
```

### Error

```
Errno::EEXIST - File exists - /Users/jenkins/.jenkins/jobs/App-iOS-Trunk/workspace/Pods
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/sandbox.rb:58:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/config.rb:202:in `new'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/config.rb:202:in `sandbox'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/command/project.rb:69:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/command/project.rb:101:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.8.2/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/command.rb:46:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/bin/pod:44:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
```

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=File+exists+-+%2FUsers%2Fjenkins%2F.jenkins%2Fjobs%2FeLearner-Native-iOS-Trunk%2Fworkspace%2FPods&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Build step 'Update CocoaPods' marked build as failure
Finished: FAILURE

对于未擦除当前工作区的其他应用程序,构建会成功。但是当我清除当前工作区时,它显示上述错误。

【问题讨论】:

    标签: ios jenkins cocoapods


    【解决方案1】:

    在调用 pod 之前在“执行 shell”脚本中添加 export LANG=en_US.UTF-8 在我的 Jenkins 机器上修复了这个问题。还可以考虑使用-d 来检查目录。

    # Cocoapods
    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    if [ -d Pods ]; then    
        rm -rf Pods
    fi
    pod repo update
    pod install
    # ...
    

    【讨论】:

    • 这对我不起作用。还有其他解决方案吗?我的是 Cocoapods1.0.1
    • @ShashankKulshrestha 您遇到的错误与原始问题中的错误不同吗?
    • @ShashankKulshrestha 更新了我的答案,增加了可能解决您问题的导出。
    • 我收到此错误 /usr/local/bin/pod repo update zsh: no such file or directory: /usr/local/bin/pod
    • @ShashankKulshrestha 将 /usr/local/bin/pod 更改为 pod
    猜你喜欢
    • 2020-01-09
    • 1970-01-01
    • 1970-01-01
    • 2021-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-15
    相关资源
    最近更新 更多