使用Jenkins&amp ;;无法构建Xcode项目荚

时间:2017-06-07 05:24:09

标签: objective-c xcode jenkins cocoapods jenkins-plugins

我们正在使用Jenkins 2.62。在尝试使用Jenkins构建时,我收到以下错误:

  

[工作空间] $ / bin / bash -l /var/folders/km/33wcncls1874x2xv50nv43480000gn/T/jenkins1804164065511577211.sh   /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:318:in to_specs': Could not find 'claide' (< 2.0, >= 1.0.0) among 32 total gem(s) (Gem::LoadError) Checked in 'GEM_PATH=file:/Users/administrator/.jenkins/plugins/ruby-runtime/WEB-INF/lib/stapler-jruby-1.209.jar!/gem:/Users/administrator/Software/ruby', execute gem env for more information from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1402:in阻止在activate_dependencies&#39;       来自/Library/Ruby/Site/2.0.0/rubygems/specification.rb:1391:in each' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1391:in activate_dependencies&#39;       来自/Library/Ruby/Site/2.0.0/rubygems/specification.rb:1373:in activate' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:67:in块中的宝石&#39;       来自/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:66:in synchronize' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:66:in gem&#39;       来自/ usr / local / bin / pod:22:在`&#39;

以下是我们在执行Shell

中使用的脚本
**rm -fr *.xcworkspace
rm -fr ~/Library/Caches/CocoaPods/
rm -fr Pods/
rm -rf ~/Library/Developer/Xcode/DerivedData/*
/usr/local/bin/pod install
xcodebuild -workspace Proj.xcworkspace -scheme Proj_test -sdk iphoneos -configuration Release archive -archivePath ${WORKSPACE}/Proj/Build/Release-iphoneos/Proj.xcarchive
xcodebuild -exportArchive -archivePath ${WORKSPACE}/ChannelConnect/Build/Release-iphoneos/Proj.xcarchive -exportOptionsPlist ${WORKSPACE}/exportOptionsPlist.plist -exportPath ${WORKSPACE}/Proj/Build/Release-iphoneos**

当我们尝试&#34; Pod Install&#34;对于手动服务器中的相同路径,它工作得很好。

我们可以更改Jenkins pods路径吗?

1 个答案:

答案 0 :(得分:0)

听起来詹金斯和你的PATH混在一起。这很常见。您必须明确告诉Jenkins将/usr/local/bin添加到您的PATH。

  1. 查看System Information -> Environment Variables下的当前内容以验证此理论。

  2. 通过添加Configure System -> Environment Variables

  3. 调整PATH="/usr/local/bin:$PATH"下的值
  4. 如果您有奴隶,则必须在Manage Nodes -> Node -> System Info

  5. 下为每个奴隶进行配置