Mac 下 fastlane 安裝 以及常見錯(cuò)誤處理

fastlane 流程化提包相關(guān)內(nèi)容,這是我一路自己安裝 以及給同事安裝遇到的問(wèn)題匯總 以及我找到的解決方案 記錄一下

安裝fastlane

sudo gem install fastlane


1>報(bào)錯(cuò): You don't have write permissions for the /usr/bin directory.?

1>解決: 將命令改為: sudo gem install fastlane -n /usr/local/bin

參考: http://www.itdecent.cn/p/b8406ff1e2f1


2>報(bào)錯(cuò): Failed to build gem native extension.

根據(jù)報(bào)錯(cuò)內(nèi)容。 會(huì)給出錯(cuò)誤日志的位置。那么在console 輸入:open 位置 查看具體報(bào)錯(cuò)內(nèi)容

In file included from if_ruby.c:113:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:33:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found #include "ruby/config.h"

2>解決: 將頭文件軟鏈接過(guò)去

cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby

? ruby sudo ln -s ../universal-darwin17/ruby/config.h ./config.h

參考: https://www.tianmaying.com/snippet/1852


3> 報(bào)錯(cuò): ERROR: Failed to build gem native extension.

make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `unf.o'. Stop.

make failed, exit code 2

3> 解決:在 ruby-2.3.0 目錄下創(chuàng)建一個(gè) universal-darwin18

在console下:

cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0

mkdir universal-darwin18

cp -r ./universal-darwin17/* ./universal-darwin18/

參考:https://github.com/vmg/redcarpet/issues/668


4> 報(bào)錯(cuò)Fastlane bundle update卡住解決方案

4> 解決? 修改源

打開工程中的Gemfile文件

source "https://rubygems.org"

替換為

source "https://gems.ruby-china.com";


更換為https://gems.ruby-china.com保存,然后再cd到你的項(xiàng)目目錄下,執(zhí)行bundle update



5> 報(bào)錯(cuò) /Library/Ruby/Site/2.3.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

from /Library/Ruby/Site/2.3.0/rubygems.rb:308:in `activate_bin_path'

from /usr/local/bin/bundle:23:in `'

5> 解決??sudo gem install bundler -n /usr/local/bin -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"


安裝fastlane過(guò)程中有可能報(bào) fastlane?requires Ruby version >= 2.2.2

這時(shí)候就需要更新ruby版本 安裝 rvm 通過(guò)rvm 來(lái)更新 ruby

?\curl -sSL https://get.rvm.io | bash -s stable


如果報(bào)invalid byte sequence in US-ASCII 。 這個(gè)錯(cuò)則需要設(shè)置 環(huán)境變量

在命令行輸入vi? ~/.bash_profile 輸入

export LC_ALL=en_US.UTF-8

export LANG=en_US.UTF-8

然后 esc? => !wq =>?

使配置生效? source?~/.bash_profile

分類:?工具類

標(biāo)簽:?工具類

好文要頂?關(guān)注我?收藏該文??

lesten

關(guān)注 - 56

粉絲 - 0

+加關(guān)注

0

0

??上一篇:?nodejs下 electron 使用 Web Termination

??下一篇:?《太平天國(guó)》紀(jì)錄片有感

posted @?2019-11-12 10:20?lesten閱讀(1641)? 評(píng)論(0)?編輯?收藏

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容