--- title: 部署 Heroku OP tags: 專案計畫 相關 --- ## <font color=Blue>**部署 Heroku/GoDaddy/Cloud Flare OP** </font> ## 需要準備 >1.註冊Heroku帳號及綁信用卡領取免費擴充450小時 >2.註冊GoDaddy帳號及購買一組網域 >3.註冊Cloud Flare帳號(http://免費轉https://) <font color="blue">**開始執行:**</font> --- >建立 Heroku 帳號 (依照官網步驟) >開新專案 creat APP / OPEN APP --- <font color="blue">終端機</font> --- 先切到本地的 master ==(要推的分支上)== 登入 >$ heroku login deploy: >$ cd my-project/ >$ git init >$ ==heroku git:remote -a sugoii== 部署到 heroku >$ git add . >$ git commit -am "make it better" >$ ==git push heroku master== 部署成功  <font color="blue">**打開 Heroku -> OPEN APP:**</font> --- 發現錯誤:  於終端機輸入 >$ heroku logs --tail (檢查錯誤訊息。)  資料table 不存在, (---這時已在 heroku 終端機---) 故終端機執行 >heroku run rails db:migrate 接下來先進入Heroku內點選右上角Open app確認網站是否成功開啟  <font color="blue">進入Cloud Flar</font> --- 接下來至已註冊好的Cloud Flar: **1. 輸入購買專案的網址**  **按下Add site**,下一步  **2. 購買完成後 等待Active打綠勾勾**  **3. 完成之後點選專案名稱進入設定,會看到以下此欄位**  **4. 先點擊DNS,進入設定內,會看到以下兩欄列**  **5. 打開一個新的網頁進入GoDaddy的DNS設定內,將網頁滑到中間會看到下列兩欄**  **6. 將上列兩欄複製起來至Cloud Flar的內的<圈起來處>新增**  後將打開  填寫如下  完成後如下  再至  **7. 開啟** <font color="blue">就可以回到網頁</font> --- 重新整理 >==將http:// 轉為 https://== **完成。**
×
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