一、重新安装ruby环境等
1.使用fastlane init
时报ruby
版本太低,去升级时发现不能升级,重新安装ruby
,可是安装过后执行rvm
命令报下面的警告。提示路径设置不正确,然后根据提示执行了rvm get stable --auto-dotfiles
配置命令可以了。
Warning! PATH is not properly set up, /Users/huanghaipo/.rvm/gems/ruby-2.0.0-p648/bin is not at first place.
2.执行过命令
二、安装成功后不能使用,报错。
用$ fastlane init
报错
/Library/Ruby/Site/2.3.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem fastlane (>= 0.a) with executable fastlane (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.3.0/rubygems.rb:308:in `activate_bin_path'
from /usr/local/bin/fastlane:23:in `<main>'
几种安装方式都用了,都不行。
sudo gem install fastlane -NV
sudo gem install -n /usr/local/bin fastlane
brew cask install fastlane
最后把fastlane
卸载,用gem install fastlane
命令安装成功,可以使用。
卸载命令
$ sudo gem uninstall fastlane -NV
$ sudo gem uninstall -n /usr/local/bin fastlane
$ brew cask uninstall fastlane
使用gem install fastlane
命令安装。
三、fastlane打包失败profile和证书不匹配
原因:项目中的签名选择的是Automatic
自动找的profile文件和证书不匹配,改为手动设置profile
文件。
RVM detected, forcing to use system ruby
Now using system ruby.
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/qz/6s9891695732y411dq855h6c0000gn/T/gym_config20190905-29644-13wmz8c.plist -archivePath '/Users/huanghaipo/Library/Developer/Xcode/Archives/2019-09-05/317huPad 2019-09-05 14.57.10.xcarchive' -exportPath /var/folders/qz/6s9891695732y411dq855h6c0000gn/T/gym_output20190905-29644-17ovr64
2019-09-05 15:00:25.425 xcodebuild[36284:478227] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/qz/6s9891695732y411dq855h6c0000gn/T/317huPad_2019-09-05_15-00-25.424.xcdistributionlogs'.
error: exportArchive: No profiles for 'com.bozhong.317huIpad' were found
Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.bozhong.317huIpad' were found" UserInfo={NSLocalizedDescription=No profiles for 'com.bozhong.317huIpad' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.bozhong.317huIpad'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}
** EXPORT FAILED **
[15:00:27]: Exit status: 70
PS:如果安装的是ruby问题建议先把ruby卸载了重新安装,我的就是,卸载重装很快就好了,不过如果你装好了,不要修改ruby的默认版本fastlane装在ruby默认版本下,修改后会找不到fastlane。