ios - EEXIST - 文件存在于工作区/Pod

标签 ios jenkins cocoapods

这是在我尝试通过 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

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

最佳答案

在调用 pod 之前在“Execute 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
# ...

关于ios - EEXIST - 文件存在于工作区/Pod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35483344/

相关文章:

ios - Swift 解析 PubNub Mach-O 错误

ios - xcode9无法使用 cocoa pod 生成.xcworkspace文件

ios - 如何在 tableview swift 中追加行?

ios - 使用约束以编程方式排列按钮

jenkins - 让 Jenkins 忽略 stderr 的方法?

Jenkins MultiJob - 使用来自内部作业的数据发送结果电子邮件

ios - 在 Core Data 中存储 UIColor 对象

ios - 如何使用 SSO 在 iOS 中实现 Facebook 登录以进行对话框提示?

python - 无法在 Jenkins 中运行 python 脚本

xcode - 我找不到 podfile