2018/1/6

第十八天:發布網站到 Heroku( 2018 iT邦幫忙鐵人賽-只要有心,人人都可以作卡米狗 )

markdown 今天我們要發布網站到 Heroku,第一步就是要先註冊一個 Heroku 帳號: # 註冊 Heroku 帳號 點開這個網址:[https://signup.heroku.com/login](https://signup.heroku.com/login) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2nmfBk-6897FC70rtAZ_lJNNq5Htnm97eLJV4iWodgATwlygRE2Vya8SLf6QhEp0Rumon92A1Vct7zOAa8exAX93WL1Y5i2XY8PVwjADKMIirMhj99lbl9_lUoGuY_w7rCqtgjhWdiJk/s1600/2.png) - First name:名字 - Last name:姓氏 - Email Address:信箱 - Role:職業 - Primary Development Language:主要開發語言 除了信箱之外,其他的都沒有很重要,怕亂填會出問題的話就抄我的。填好之後就按 `CREATE FREE ACCOUNT`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCE9TVPZvqQHajbuwwGSoldALXG-yUSesvqS84PyBOjeTk_ZyRVfeF8fXuUlcyfDN7xP_KvNclhict_S1vKTK0LZe9S0sIUUx4u7ksvzNbrTXsCLgbmi6yf_jhiysRWaFZ-0KHFt8fX74/s1600/3.jpg) 他說:「請去收信,謝謝」,這個步驟是為了確認你真的有你所填的信箱。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1cbyUx2bMdHt408IYMUx7P53gb4evUL4jYQG9eFSkXILlAqvxPdlTh_2gXRRTd7Np4WKH8RxQYucxo4EtP_7mE5c1tae07kAg-149ORXqQIq6wPHSj4LNY4IDzKbRFkvgnKlx_7aT01w/s1600/4.jpg) 這裡點一下信中的超連結: ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiu7eiO8U79Dg6JH9KBVCPmV8uWAFgkY2KGG6PcPnTW9hSyO7DpSw2z9PPb5_17JMA8tfimtKRMLbMFkzBtZ4o64QlgFiVA7S2sKYDbGNf7JhckMoiASWIP8vwMoEIp8wZYDANuEU6lS0/s1600/5.jpg) 這裡要輸入兩次密碼,密碼最少要 8 個字,輸入完之後按下 `SET PASSWORD AND LOG IN`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiOMrRqwjIoRzZf5j_EE_sLtwutOadL57RAExj-mMFC-w4WiitRSMms-QVN95zBVfbsjs1kHov2lwLZjJUsCt1Is5_ugvdvaUwsqHhT4dEhbRRJ8ld2fweY65NDPNLlzDjCiFrHouUeo4/s1600/6.jpg) 他說:「歡迎光臨」,這裡點一下 `CLICK HERE TO PROCEED`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPABGUk9XXd-bJqQPtP0CNCyUNnu3BpZ2JrsegUJ_bqoec0Z9fmS6y07zVJg64hOgtzaPOOyGTympkqhQUMfWx8y219bDZN4AAABYpY57aQLpIMHbQ7e5JiZdEtNzf4RTpFV7VvAtV0EU/s1600/7.jpg) 這是平常登入會看到的畫面,他提供了各種教學,不過不用看他的,看我的就好。 我們平常不會透過這個後台去操作他,我們會使用 Heroku 提供的 Heroku CLI 來操作他。 # 安裝 Heroku CLI 點開這個網址:[https://devcenter.heroku.com/articles/heroku-cli#windows](https://devcenter.heroku.com/articles/heroku-cli#windows) 然後點 `64-bit` 下載安裝檔,下載後點開。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEind8QNL5kl77il4u7XBcwxJE_j6UUJ7IEg0t9yyoKhyphenhyphenwxTOGO6yccBQZjOF_04vxzgICkSpSJkycsDn0GuyjMvI9Dyip5rYuRrCQwjGzeah9ZDzHr-l9F23pp7J67Ej-EGfSG281HMnSw/s1600/8.jpg) 這邊直接點 `Next`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9g7jHuMNu8arG8I5to4wGNf5um2aGQF3zKgE32t3P6lG7QtjqiJpJNDKfdBbmyUuztoCbpfhNns0G05f70OxXGpCtw3XQBIueLIh56toaeZh-morFjTMJpRowc1aIl7AOE_-bA3yqaHA/s1600/9.jpg) 點 `Next`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtyo8ut0ymjSon6b1HdWzll-8eYZXyODNaBaybtMyIvbyAenS8PN3L_CMJNg5Oqa_1nPqP50RrnoOQ3ddynUBPFpfMyxiKRSYz1of4sWuT0jgLqy5CRn5OTa5Wg7-ZFJpGT_0x96w9cMs/s1600/10.jpg) 安裝完成!點 `Close`。 然後什麼事也沒發生。所以我們剛剛安裝了什麼? # 試用 Heroku CLI 開啟一個小黑框,輸入 `heroku`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh33bkQ0dD7Q8QTCaV_0HXq-w8EBBIzszrczFHE5p1mvOrO6j1C-rpieAvwi56qTz-CNGAq5o5zymf30hmqsb1Mg9p-DjnRHXGcjBCvta_YL7VQGeok3hzrXYEDp2yaQOUnxtnh72_hEbU/s1600/11.jpg) 如果你沒有看到這個畫面,那表示你可能在安裝的過程中遭遇到一些問題。或許可以考慮下載 `32-bit` 的安裝檔重裝一次看看。 這裡是指令教學,跟卡米狗教學差不多,不過不用看他的,看我的就好。 輸入 `heroku login` 作登入: ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2zasHRsSQNOPyir94EH7qniOeRf4NkkftatCQnQ0Cu0hBGNKPxSMwmOE8Pzy7Bfw41_SmABEqwLbjrBIIOwb421F7A0jT5GDCKa2BK4dkL3ky2rHBBftRws-_GTa224t25STj4c7RTLU/s1600/13.jpg) 他說:「請輸入信箱:」 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUZtN4gtX0S-qBCU9ZkSX2_K4Q4Y23UKiDY9CzeWCmdHes08vgbYzP5l5ZauQrucjhPpvnDKOnoePb7-7l9a0X0AE2qyLxCyDwqqYlzSyOJGmtoSBu6cg2K1SEXjcQ3fP2dgP6P6Z3cCg/s1600/14.jpg) 他說:「請輸入密碼:」 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE9vsPg38vviv0rkEr0bWHpu70xmBggasB8xSqUXJFtLocoT_-cX5Tx7lzamZUebOD3yXaek2wlEXgptuHXd0nJ7tudnf_2skN2nlgbAPqMTHFl_HJLgEAsbnM593y9dsGxLpGlSZ3AYM/s1600/12.jpg) 他說:「登入成功。」 heroku 的初始設定到這裡就算完成了,接下來我們安裝 Git。 # 安裝 Git 點開這個網址:[https://git-scm.com/download/win](https://git-scm.com/download/win),沒意外的話點開就已經自動下載了。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi06PWHj3UNA0_YDhOfUX8cLDoVr3iyb2Hqk71LpG6FQaC6WiiDcE7odmWx9pZsfxqI_RLty63GTXBFH9jsAgcUyGLKnksxF_kD8cZWr98EpZeOFJeEfHTo17bcjfAqIGte8XyeQEkjais/s1600/18.jpg) 要開始安裝了,安裝流程很長,注意看我選什麼,跟著選就對了。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSlSD45arz98wnNrgujNfij8_JH1fjroLtmjQh92MLt5tC3lhEfgBTV1EkEnH5oiu_PyKy3LMkdYbo2-SqJoiSm2t5wTP-XZlrwJVvJmLvEzAn0o_pJZ1lGgTM-FL1ZKL4J0Z3xbID5qM/s1600/16.jpg) 這是填安裝路徑,沒事不要亂改。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXZWpXPpEoCLGp5IY_0Z1MhWKKJ5Y0SkHup4R0xjsHwYPo9ZiaESU0Q2UTYOzJJ0Zh3-sRBK2Yjo_cuQmIJ4M_Nouc9ZAnoqQXK3Hecntgbe-S2Ws6yQ3bBt3K-h7wYA1NUb48tRjzBJE/s1600/17.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg43xzGYrZ3jyQe9s9Tc9xr4SMr7yviKkjK7VZMHXbV_gV_H8OgTn7t58jCNPRIiKbV6fCcQUX9x99oQ0AmXUTgFRswOdsP0VeTeM5EAbPNJHoZ4YaIjyfe34sbJKtLf3wrcdH9E_AA-ZA/s1600/18.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7SY8D7L8_SMtQksABI2ZOaaJbIBGdXy8hyMg9Uv5X5O9zuu5h4f6ou5wt3n4AzJiJOY0zA0d-Y3iuqluVGrLWXon9DixXU6lQRUjZ7HTI0WczzWHoXdFfjH9rak8Pcydzj2f9hfjyMFQ/s1600/19.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP5hHx47BIfw2eIwWgo9M_14wvcx59D0iw6V-OQnMSHLbq1oR-7B6j5wIsKyiWLRi0S8BbBsiJ1_opdRHXQQdVGyhZ-FWF1dRJqpqVvTvdt97uyiO10N_oNw7ZbB_1epoUUmSJoKayOWE/s1600/20.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuRC79uaiWpcvuMRbbGzN-zjUhhuHlWigA9BqvoTzpi33n0O3HQh0epxF8lX0VhMGBvWBUWiqsqVCLnZPMs_IOVIhZlzZKRCndhL9gTHV9v-C4RleZ3QnnYt4-mj-KHWZ6Y5k2u4-Iw6s/s1600/21.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGW6dYOTJuShxBJonVDSf_lV7HCAjUpef66UXRXfwf_MGPrj3nTUP0lbHRzdkiE1MIt4sYdBignLQgNKbF1_QSHVfTwfySKhgVygD6f34xpbx-vUb6OglJyRfZojCWNdD4sFu3Zij3Yw0/s1600/22.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8RRKlRIpoQgKEmqUi5cEDgPY7UpYrXUEbrFU99dQy6J6MS85nax_RTWLSdOSKKUNRiEorad90KSJYODWx5oMhXD7ROleesvTxe-rnWsNuXVhChS89Ko3Y6_d8JHrZX-SnWruocqXZGmc/s1600/23.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYed0cklwMeVXi2bc9AnLC9958wEGlrLPsLp4i15eTjnpo8urRQV16kMvoaJ9C3wX1kTBwqyz5g0SaDhpSDInwgxcBHWLri5_VTmdvKkgw6B7DzUoteS91fOZu9wWfa7cFLhm7KZXdfzQ/s1600/24.jpg) ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq09wTG32u4QZde1RHGYNkg6gPVjpO9V2TDgQErPmceLwLXaZkZBOl7VfPXsFRLNjgpb3dOyM9md1aD403-CxPUd9r8wj12pXZ2ow1-qEgyI96smit05V4MEQkCuj2OjWkAmmLnR9OiUY/s1600/25.jpg) 跟 Heroku 一樣,這個安裝好之後要到小黑框才能用。 # 試用 Git 開啟一個小黑框,輸入 `git`。 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOd1nYHUrIyPq7OVqd0N-ulf1ywrvmD0NuPuVShPJv2V6WXjnM_la_31WZohO5_-e8DTsh-Ol9eBEg-xwG7wgdc2Z7Z4Ob9VxE6vSNOtJmMnGbuGbfhY5R58n0xeyqRX83oHkwko7IAIg/s1600/26.jpg) 如果你沒有看到上面的畫面,那表示你可能在安裝的過程中遭遇到一些問題。遇到問題的話請截圖留言。 #在我的電腦上是好的 到這裡 git 就安裝完成了。 # 專案的 git 初始設定 我們會使用小黑框來上傳程式,先開一個在專案目錄下的小黑框,然後輸入 `git init`。 你可能會看到: ``` D:\只要有心,人人都可以作卡米狗\ironman>git init Initialized empty Git repository in D:/只要有心,人人都可以作卡米狗/ironman/.git/ ``` 或者看到: ``` D:\只要有心,人人都可以作卡米狗\ironman>git init Reinitialized existing Git repository in D:/只要有心,人人都可以作卡米狗/ironman/.git/ ``` 看到這兩個其中一個都是正常現象,都沒關係,看到其他的就見鬼啦。 # 專案的 heroku 初始設定 我們要在 heroku 建立一台新的網頁伺服器,輸入的指令是 `heroku create ` + 專案名稱,這個名稱要夠特殊,要不然會跟別人撞名。 我選的專案名稱是 `people-all-love-kamigo`,所以我輸入 `heroku create people-all-love-kamigo`。 ``` D:\只要有心,人人都可以作卡米狗\ironman>heroku create people-all-love-kamigo Creating people-all-love-kamigo... done https://people-all-love-kamigo.herokuapp.com/ | https://git.heroku.com/people-all-love-kamigo.git D:\只要有心,人人都可以作卡米狗\ironman> ``` 建立好之後回到 heroku 的後台([https://dashboard.heroku.com/apps](https://dashboard.heroku.com/apps))上你會看到一個 app: ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVaOg88lWTvtL0iP7FQ9bgiOoeF2g_j86-utaQqEePbASGLMLG88mRER8c00k_9_Lh30x71UVBdOOqu36L7fpdjWgeHiF_tQ_0AdWSnw7ix8hT1vX1xjdgd9A5Aj7owDubwAhnV8CyyN0/s1600/27.jpg) 在 heroku 上面網頁伺服器被稱為 app,這就是我們剛剛建立的網頁伺服器。 # 上傳程式碼到 Heroku 我們要使用 git 來上傳程式碼,而 git 是一款非常強大的版本控管軟體,擁有非常多的功能。但我們要上傳程式碼只需要學習其中的 3 個指令。 - git add - git commit - git push 一個個來,首先是 git add,git add 可以指定這次想要加入控管的檔案,我們輸入 `git add .`,表示我們想把所有的檔案都加入控管。 ``` D:\只要有心,人人都可以作卡米狗\ironman>git add . warning: LF will be replaced by CRLF in .gitignore. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in Gemfile. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in Gemfile.lock. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in README.md. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in Rakefile. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/assets/config/manifest.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/assets/javascripts/application.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/assets/javascripts/cable.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/assets/stylesheets/application.css. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/channels/application_cable/channel.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/channels/application_cable/connection.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/controllers/application_controller.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/helpers/application_helper.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/jobs/application_job.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/mailers/application_mailer.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/models/application_record.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/views/layouts/application.html.erb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/views/layouts/mailer.html.erb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/views/layouts/mailer.text.erb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in bin/bundle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in bin/rails. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in bin/rake. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in bin/setup. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in bin/update. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in bin/yarn. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config.ru. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/application.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/boot.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/cable.yml. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/database.yml. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/environment.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/environments/development.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/environments/production.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/environments/test.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/application_controller_renderer.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/assets.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/backtrace_silencers.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/cookies_serializer.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/filter_parameter_logging.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/inflections.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/mime_types.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/initializers/wrap_parameters.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/locales/en.yml. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/puma.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/routes.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in config/secrets.yml. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in db/seeds.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in package.json. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in public/404.html. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in public/422.html. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in public/500.html. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in public/robots.txt. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in test/application_system_test_case.rb. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in test/test_helper.rb. The file will have its original line endings in your working directory. D:\只要有心,人人都可以作卡米狗\ironman> ``` 一堆訊息但不是很重要,他說:「我把 windows 的換行符號改成別種系統的換行符號了哦。」 接下來是 git commit, git commit 表示我們想要建立一個新的版本,我們要留下一些紀錄說明這個版本作了什麼變更,因為是第一次,所以我們輸入 `git commit -m init`。 ``` D:\只要有心,人人都可以作卡米狗\ironman>git commit -m init [master (root-commit) 8c48959] init 76 files changed, 1203 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.md create mode 100644 Rakefile create mode 100644 app/assets/config/manifest.js create mode 100644 app/assets/images/.keep create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/cable.js create mode 100644 app/assets/javascripts/channels/.keep create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/channels/application_cable/channel.rb create mode 100644 app/channels/application_cable/connection.rb create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/concerns/.keep create mode 100644 app/controllers/kamigo_controller.rb create mode 100644 app/helpers/application_helper.rb create mode 100644 app/jobs/application_job.rb create mode 100644 app/mailers/application_mailer.rb create mode 100644 app/models/application_record.rb create mode 100644 app/models/concerns/.keep create mode 100644 app/views/kamigo/eat.html create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/mailer.html.erb create mode 100644 app/views/layouts/mailer.text.erb create mode 100644 bin/bundle create mode 100644 bin/rails create mode 100644 bin/rake create mode 100644 bin/setup create mode 100644 bin/update create mode 100644 bin/yarn create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/cable.yml create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/initializers/application_controller_renderer.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/puma.rb create mode 100644 config/routes.rb create mode 100644 config/secrets.yml create mode 100644 db/seeds.rb create mode 100644 lib/assets/.keep create mode 100644 lib/tasks/.keep create mode 100644 log/.keep create mode 100644 package.json create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/apple-touch-icon-precomposed.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 test/application_system_test_case.rb create mode 100644 test/controllers/.keep create mode 100644 test/fixtures/.keep create mode 100644 test/fixtures/files/.keep create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/models/.keep create mode 100644 test/system/.keep create mode 100644 test/test_helper.rb create mode 100644 tmp/.keep create mode 100644 vendor/.keep D:\只要有心,人人都可以作卡米狗\ironman> ``` 一樣一堆訊息,他說:「這次建立的版本新增了這些檔案哦。」 「好哦~好哦~」 接下來是 git push,git push 可以把我們建立好的版本,傳送到遠端的 git server,當然我們是要傳送到 heroku,所以我們輸入的是 `git push heroku master`。 ``` D:\只要有心,人人都可以作卡米狗\ironman>git push heroku master Counting objects: 85, done. Delta compression using up to 4 threads. Compressing objects: 100% (70/70), done. Writing objects: 100% (85/85), 20.55 KiB | 1.28 MiB/s, done. Total 85 (delta 2), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. remote: Detected buildpacks: Ruby,Node.js remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.3.4 remote: ###### WARNING: remote: Removing `Gemfile.lock` because it was generated on Windows. remote: Bundler will do a full resolve so native gems are handled properly. remote: This may result in unexpected gem versions being used in your app. remote: In rare occasions Bundler may not be able to resolve your dependencies at all. remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile remote: remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. remote: Fetching gem metadata from https://rubygems.org/.......... remote: Fetching version metadata from https://rubygems.org/.. remote: Fetching dependency metadata from https://rubygems.org/. remote: Resolving dependencies... remote: Fetching rake 12.3.0 remote: Fetching concurrent-ruby 1.0.5 remote: Fetching minitest 5.11.1 remote: Installing minitest 5.11.1 remote: Installing rake 12.3.0 remote: Installing concurrent-ruby 1.0.5 remote: Fetching thread_safe 0.3.6 remote: Installing thread_safe 0.3.6 remote: Fetching builder 3.2.3 remote: Installing builder 3.2.3 remote: Fetching erubi 1.7.0 remote: Fetching mini_portile2 2.3.0 remote: Installing erubi 1.7.0 remote: Fetching crass 1.0.3 remote: Installing mini_portile2 2.3.0 remote: Fetching rack 2.0.3 remote: Installing crass 1.0.3 remote: Fetching nio4r 2.2.0 remote: Installing rack 2.0.3 remote: Installing nio4r 2.2.0 with native extensions remote: Fetching websocket-extensions 0.1.3 remote: Installing websocket-extensions 0.1.3 remote: Fetching mini_mime 1.0.0 remote: Installing mini_mime 1.0.0 remote: Fetching arel 8.0.0 remote: Installing arel 8.0.0 remote: Using bundler 1.15.2 remote: Fetching coffee-script-source 1.12.2 remote: Fetching execjs 2.7.0 remote: Installing execjs 2.7.0 remote: Installing coffee-script-source 1.12.2 remote: Fetching method_source 0.9.0 remote: Fetching thor 0.20.0 remote: Installing method_source 0.9.0 remote: Installing thor 0.20.0 remote: Fetching ffi 1.9.18 remote: Fetching multi_json 1.12.2 remote: Installing multi_json 1.12.2 remote: Fetching puma 3.11.0 remote: Installing puma 3.11.0 with native extensions remote: Installing ffi 1.9.18 with native extensions remote: Fetching rb-fsevent 0.10.2 remote: Installing rb-fsevent 0.10.2 remote: Fetching tilt 2.0.8 remote: Installing tilt 2.0.8 remote: Fetching sqlite3 1.3.13 remote: Installing sqlite3 1.3.13 with native extensions remote: Fetching turbolinks-source 5.0.3 remote: Installing turbolinks-source 5.0.3 remote: Fetching i18n 0.9.1 remote: Installing i18n 0.9.1 remote: Fetching tzinfo 1.2.4 remote: Installing tzinfo 1.2.4 remote: Fetching nokogiri 1.8.1 remote: Installing nokogiri 1.8.1 with native extensions remote: Fetching websocket-driver 0.6.5 remote: Installing websocket-driver 0.6.5 with native extensions remote: Fetching mail 2.7.0 remote: Installing mail 2.7.0 remote: Fetching rack-test 0.8.2 remote: Installing rack-test 0.8.2 remote: Fetching sprockets 3.7.1 remote: Installing sprockets 3.7.1 remote: Fetching uglifier 4.1.2 remote: Installing uglifier 4.1.2 remote: Fetching coffee-script 2.4.1 remote: Installing coffee-script 2.4.1 remote: Fetching turbolinks 5.0.1 remote: Installing turbolinks 5.0.1 remote: Fetching activesupport 5.1.4 remote: Installing activesupport 5.1.4 remote: Fetching rb-inotify 0.9.10 remote: Installing rb-inotify 0.9.10 remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. remote: current directory: remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3 remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/ruby-2.3.4/bin/ruby -r remote: ./siteconf20180106-281-1k06dok.rb extconf.rb remote: checking for sqlite3.h... no remote: sqlite3.h is missing. Try 'brew install sqlite3', remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' remote: and check your shared library search path (the remote: location where your sqlite3 shared library is located). remote: *** extconf.rb failed *** remote: Could not create Makefile due to some reason, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for more details. You may remote: need configuration options. remote: Provided configuration options: remote: --with-opt-dir remote: --without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote: --with-make-prog remote: --without-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/ruby-2.3.4/bin/$(RUBY_BASE_NAME) remote: --with-sqlite3-config remote: --without-sqlite3-config remote: --with-pkg-config remote: --without-pkg-config remote: --with-sqlite3-dir remote: --without-sqlite3-dir remote: --with-sqlite3-include remote: --without-sqlite3-include=${sqlite3-dir}/include remote: --with-sqlite3-lib remote: --without-sqlite3-lib=${sqlite3-dir}/lib remote: To see why this extension failed to compile, please check the mkmf.log which can remote: be found here: remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log remote: extconf failed, exit code 1 remote: Gem files will remain installed in remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13 remote: for inspection. remote: Results logged to remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot remote: continue. remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling. remote: In Gemfile: remote: sqlite3 remote: Bundler Output: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. remote: Fetching gem metadata from https://rubygems.org/.......... remote: Fetching version metadata from https://rubygems.org/.. remote: Fetching dependency metadata from https://rubygems.org/. remote: Resolving dependencies... remote: Fetching rake 12.3.0 remote: Fetching concurrent-ruby 1.0.5 remote: Fetching minitest 5.11.1 remote: Installing minitest 5.11.1 remote: Installing rake 12.3.0 remote: Installing concurrent-ruby 1.0.5 remote: Fetching thread_safe 0.3.6 remote: Installing thread_safe 0.3.6 remote: Fetching builder 3.2.3 remote: Installing builder 3.2.3 remote: Fetching erubi 1.7.0 remote: Fetching mini_portile2 2.3.0 remote: Installing erubi 1.7.0 remote: Fetching crass 1.0.3 remote: Installing mini_portile2 2.3.0 remote: Fetching rack 2.0.3 remote: Installing crass 1.0.3 remote: Fetching nio4r 2.2.0 remote: Installing rack 2.0.3 remote: Installing nio4r 2.2.0 with native extensions remote: Fetching websocket-extensions 0.1.3 remote: Installing websocket-extensions 0.1.3 remote: Fetching mini_mime 1.0.0 remote: Installing mini_mime 1.0.0 remote: Fetching arel 8.0.0 remote: Installing arel 8.0.0 remote: Using bundler 1.15.2 remote: Fetching coffee-script-source 1.12.2 remote: Fetching execjs 2.7.0 remote: Installing execjs 2.7.0 remote: Installing coffee-script-source 1.12.2 remote: Fetching method_source 0.9.0 remote: Fetching thor 0.20.0 remote: Installing method_source 0.9.0 remote: Installing thor 0.20.0 remote: Fetching ffi 1.9.18 remote: Fetching multi_json 1.12.2 remote: Installing multi_json 1.12.2 remote: Fetching puma 3.11.0 remote: Installing puma 3.11.0 with native extensions remote: Installing ffi 1.9.18 with native extensions remote: Fetching rb-fsevent 0.10.2 remote: Installing rb-fsevent 0.10.2 remote: Fetching tilt 2.0.8 remote: Installing tilt 2.0.8 remote: Fetching sqlite3 1.3.13 remote: Installing sqlite3 1.3.13 with native extensions remote: Fetching turbolinks-source 5.0.3 remote: Installing turbolinks-source 5.0.3 remote: Fetching i18n 0.9.1 remote: Installing i18n 0.9.1 remote: Fetching tzinfo 1.2.4 remote: Installing tzinfo 1.2.4 remote: Fetching nokogiri 1.8.1 remote: Installing nokogiri 1.8.1 with native extensions remote: Fetching websocket-driver 0.6.5 remote: Installing websocket-driver 0.6.5 with native extensions remote: Fetching mail 2.7.0 remote: Installing mail 2.7.0 remote: Fetching rack-test 0.8.2 remote: Installing rack-test 0.8.2 remote: Fetching sprockets 3.7.1 remote: Installing sprockets 3.7.1 remote: Fetching uglifier 4.1.2 remote: Installing uglifier 4.1.2 remote: Fetching coffee-script 2.4.1 remote: Installing coffee-script 2.4.1 remote: Fetching turbolinks 5.0.1 remote: Installing turbolinks 5.0.1 remote: Fetching activesupport 5.1.4 remote: Installing activesupport 5.1.4 remote: Fetching rb-inotify 0.9.10 remote: Installing rb-inotify 0.9.10 remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. remote: remote: current directory: remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3 remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/ruby-2.3.4/bin/ruby -r remote: ./siteconf20180106-281-1k06dok.rb extconf.rb remote: checking for sqlite3.h... no remote: sqlite3.h is missing. Try 'brew install sqlite3', remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' remote: and check your shared library search path (the remote: location where your sqlite3 shared library is located). remote: *** extconf.rb failed *** remote: Could not create Makefile due to some reason, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for more details. You may remote: need configuration options. remote: remote: Provided configuration options: remote: --with-opt-dir remote: --without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote: --with-make-prog remote: --without-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/ruby-2.3.4/bin/$(RUBY_BASE_NAME) remote: --with-sqlite3-config remote: --without-sqlite3-config remote: --with-pkg-config remote: --without-pkg-config remote: --with-sqlite3-dir remote: --without-sqlite3-dir remote: --with-sqlite3-include remote: --without-sqlite3-include=${sqlite3-dir}/include remote: --with-sqlite3-lib remote: --without-sqlite3-lib=${sqlite3-dir}/lib remote: remote: To see why this extension failed to compile, please check the mkmf.log which can remote: be found here: remote: remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log remote: remote: extconf failed, exit code 1 remote: remote: Gem files will remain installed in remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13 remote: for inspection. remote: Results logged to remote: /tmp/build_64f38be744eeec1bbcc825497e62d9fc/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out remote: remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot remote: continue. remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling. remote: remote: In Gemfile: remote: sqlite3 remote: ! remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku: remote: ! https://devcenter.heroku.com/articles/sqlite3 remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to people-all-love-kamigo. remote: To https://git.heroku.com/people-all-love-kamigo.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/people-all-love-kamigo.git' D:\只要有心,人人都可以作卡米狗\ironman> ``` 一樣是一堆訊息,其實他這步驟作了非常多的事情,不過我們只要關注結果就好,結果就是 `Push rejected, failed to compile Ruby app.`,失敗惹。 失敗的原因寫在上面: ``` remote: In Gemfile: remote: sqlite3 remote: ! remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku: remote: ! https://devcenter.heroku.com/articles/sqlite3 ``` heroku:「ㄉㄅㄑ,我不會用 sqlite3。」 今天就先到這裡,明天再講怎麼修。

沒有留言: