【问题标题】:Xcode 12, Mac OS 10.15, Xcode server pre-integration scripts for install cocoapodsXcode 12、Mac OS 10.15、用于安装 cocoapods 的 Xcode 服务器预集成脚本
【发布时间】:2021-01-08 08:51:35
【问题描述】:

我是 Xcode 服务器 CI 的新手,这就是我的预集成脚本的样子:

#!/bin/sh
#make sure the encoding is correct
export LANG=en_US.UTF-8

# fix the path so Ruby can find it's binaries
export PATH=/usr/local/bin:$PATH
echo "PATH: $PATH"

# update or install depending on what we got
if [ -d ${PODS_DIR} ]; then 
    # pods directory exist
    echo "=================="
    echo "   Delete Pods"
    echo "=================="

    # delete cocoapods files if they exist
    rm -rf "${PODS_DIR}"
    eval rm "${BS_SRCROOT}/Podfile.lock"
    eval rm -rf "${BS_SRCROOT}/${BS_EXECUTABLE_NAME}.workspace"
    echo "Deleted Pods directory ${PODS_DIR}"
    echo "Deleted ${BS_EXECUTABLE_NAME}.workspace"
    echo "Deleted Podfile.lock"
else 
    # no need to delete pod files
    echo "Pods NOT detected at ${PODS_DIR}"
fi

echo "=================="
echo "   Install Pods"
echo "=================="

# make sure we are where we need to be
eval cd "${BS_SRCROOT}"
/usr/local/bin/pod install

触发集成后,集成日志中出现以下问题:

PATH: /usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
==================
   Delete Pods
==================
rm: /Podfile.lock: No such file or directory
Deleted Pods directory 
Deleted .workspace
Deleted Podfile.lock
==================
   Install Pods
==================
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
    from /usr/local/bin/pod:23:in `<main>'
    from /usr/local/bin/ruby_executable_hooks:24:in `eval'
    from /usr/local/bin/ruby_executable_hooks:24:in `<main>'

我已经重新安装了 ruby​​,将 rvm 更新为稳定版,重新安装了 cocoapods,这些都没有帮助

请帮忙,在此先感谢

【问题讨论】:

    标签: ruby continuous-integration rvm xcode-server xcs


    【解决方案1】:

    你必须安装:

    gem update --system
    gem install bundler
    gem install cocoapods
    rvm install 2.6.3
    rvm --default use 2.6.3
    

    再次运行 Xcode Server :) 参考:https://github.com/fastlane/fastlane/issues/15183

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-31
      • 2014-04-18
      • 1970-01-01
      • 1970-01-01
      • 2020-03-03
      • 2011-12-01
      相关资源
      最近更新 更多