【发布时间】: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