2016-02-18 32 views
3

這是發生當我試圖通過Jenkins構建應用程序。 我已經消滅了在詹金斯當前工作空間和構建應用程序和其拋出以下錯誤EEXIST - 文件存在工作區/ Pods

[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 

對於其當前工作區是不是不抹其他應用程序的構建變得成功。但是當我清除當前工作空間它顯示上面的錯誤。

回答

4

在調用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 
# ... 
+0

這不適合我。其他解決方案?我的是Cocoapods1.0.1 –

+0

@ShashankKulshrestha你會得到與原始問題不同的錯誤嗎? – JAL

+0

添加我的錯誤作爲新的職位請參閱 –