# bfb環境建置 ###### tags: `AMJX` 在這裡會提到以下環境建置: 1. 第三方套件管理平台(Cocoapods) 2. 第三方套件管理平台(Homebrew) 3. 更改您的 target --- # 1. 第三方套件管理平台(Cocoapods)  第三方套件配置要注意以下: * pod 請用 install 不要使用 update,update會覆寫podfile lock 請注意。 * 此第三方套件管理為CocoaPods,在執行專案時請務必安裝CococaPods: 1. 打開終端機 (不知道怎麼開的人可以按下 command+space,然後輸入 terminal)  2. 查看當前 Ruby 版本 ``` //Terminal command code: ruby -v ```  3. 升級 Ruby,首先要先安裝 rvm ``` //Terminal command code: curl -L get.rvm.io | bash -s stable ```  4. 安裝完 rvm 還要設定環境參數 ``` //Terminal command code: source ~/.bashrc source ~/.bash_profile ``` 5. 查看 rvm 版本 ``` //Terminal command code: rvm -v ```  6. 列出可安裝的 Ruby 版本,然後看最近的版本號是多少,這時最新版本為 2.6.0 (隨著時間往後,版本只會越來越新) ``` //Terminal command code: rvm list known ```  7. 安裝 Ruby 最新版本,這裡是安裝 2.6.0-preview2。(注意:在安裝過程中,會需要輸入密碼,此密碼為開機密碼) ``` //Terminal command code: //這邊要輸入自己要安裝的版本呦! rvm install 2.6.0-preview2 ``` 8. 安裝完成後,再次確認 Ruby 版本是否正確 ``` //Terminal command code: ruby -v ```  9. 開始安裝 CocoaPods,安裝過程中一樣需要輸入開機密碼。當看到『Done installing documentation』就代表已經安裝完成。 10. 安裝完後,開始要讓 CocoaPods 自己設定了。看到『Setup completed』就代表設定完成了。 ``` //Terminal command code: pod setup ```  11. 確認 CocoaPods 版本 ``` //Terminal command code: pod --version ```  在執行pod  # 2. 第三方套件管理平台(Homebrew) 此專案執行 cocoapods 需要 CommandLineTools , 如需要安裝該功能需要安裝 Homebrew。  請在您的終端機貼上這段程式碼: ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` # 3. 修改 Podfile 1. 到專案資料夾,點選右鍵。 2.  點選新增位於檔案夾位置的終端機視窗。 輸入以下程式碼,確認 Podfile 內容。 ``` cat Podfile ``` 此時會看到以下的套件資訊。  輸入以下程式碼,修改 Podfile ``` vim Podfile ``` 請確認 target 指定的位置,請指向 'AMJX' 輸入 write & quit 離開並且儲存。 ``` :wq ``` # 切換 target 可以參考
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up