iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 29
0
Modern Web

RRRR的世界 (Ruby on Rails + React + Redux)系列 第 29

Day 29, Deploy上heroku吧!

終於到了今天,要push上heroku了。

本文參考官方文件實作:

  1. Rails 5 and Heroku: https://devcenter.heroku.com/articles/getting-started-with-rails5
  2. Multiple buildpacks: https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app
  3. Heroku CLI: https://devcenter.heroku.com/articles/heroku-cli

我就不講怎麼在Heroku建立帳號了...

先安裝 Heroku CLI

  1. Heroku Command Line:
    http://ithelp.ithome.com.tw/upload/images/20170113/20103835I6jtdaGPEs.png

  2. 然後先create app:
    http://ithelp.ithome.com.tw/upload/images/20170113/20103835ZNCDkfdcRZ.png

  3. 先加入builpacks for ruby and npm:
    http://ithelp.ithome.com.tw/upload/images/20170113/20103835c93E6DZdZV.png

  4. 加入postgres addons:
    http://ithelp.ithome.com.tw/upload/images/20170113/20103835khvunb9VE3.png

好 前置作業完成 把RRRR push上去

  1. push to heroku
    http://ithelp.ithome.com.tw/upload/images/20170113/201038357XKoY3gNQm.png

  2. db:migrate
    http://ithelp.ithome.com.tw/upload/images/20170113/20103835jMQvkHvkHG.png

如果噴error,請看http://stackoverflow.com/questions/20293895/rails-4-0-1-on-heroku-cant-create-database

  1. 最後 open heroku!
    http://ithelp.ithome.com.tw/upload/images/20170113/201038357Y4mbrKLYW.png

搞定囉!!
請上 https://it-help-rrrr.herokuapp.com/ 看看結果~
倒數第二天!!要結束啦~~~


上一篇
Day 28, State in Redux or React? 搞混了嗎~
下一篇
Day 30, 最後一天來個RRRR的總結。
系列文
RRRR的世界 (Ruby on Rails + React + Redux)30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言