2018/1/6

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

markdown 今天我們要發布網站到 Heroku,第一步就是要先註冊一個 Heroku 帳號: # 註冊 Heroku 帳號 點開這個網址:[https://signup.heroku.com/login](https://signup.heroku.com/login) ![](https://3.bp.blogspot.com/-WpYi1A33qDM/WlA3JLHDFzI/AAAAAAABAKw/IPs0HD5nvs09Qd6Htb4H5fM_-0qUrl1XwCLcBGAs/s1600/2.png) - First name:名字 - Last name:姓氏 - Email Address:信箱 - Role:職業 - Primary Development Language:主要開發語言 除了信箱之外,其他的都沒有很重要,怕亂填會出問題的話就抄我的。填好之後就按 `CREATE FREE ACCOUNT`。 ![](https://3.bp.blogspot.com/-9RyyGDAZVQY/WlA48MDgYbI/AAAAAAABAK8/ZIbN7UF6KfQVu_SdYWsKNmR405f507argCLcBGAs/s1600/3.jpg) 他說:「請去收信,謝謝」,這個步驟是為了確認你真的有你所填的信箱。 ![](https://4.bp.blogspot.com/-SiZhQZ2hlD0/WlA5an58ehI/AAAAAAABALE/LT6QlcMLH7E2w5oeSsM09RqGosw9RZVmQCLcBGAs/s1600/4.jpg) 這裡點一下信中的超連結: ![](https://2.bp.blogspot.com/-Y9PWMQTreks/WlA57N70JVI/AAAAAAABALM/QGgmgMKbC38Z75a0pEMH2bkPt2MBKJIMQCLcBGAs/s1600/5.jpg) 這裡要輸入兩次密碼,密碼最少要 8 個字,輸入完之後按下 `SET PASSWORD AND LOG IN`。 ![](https://2.bp.blogspot.com/-wkaHIUBpID8/WlA7D_ALOXI/AAAAAAABALc/THQvTt4Iaqc0z3c0I2KAnPyDXtFF33y_QCLcBGAs/s1600/6.jpg) 他說:「歡迎光臨」,這裡點一下 `CLICK HERE TO PROCEED`。 ![](https://3.bp.blogspot.com/-Xz-bPfzb5vw/WlA7VG9sDOI/AAAAAAABALg/XZYSm0hRqRMMWPrb9Eaemkb03_h48N86gCLcBGAs/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://2.bp.blogspot.com/-5PPdQS_EaJ4/WlA9syp61FI/AAAAAAABALs/T_lg08fULK44YZTSgs2khwthEJvyoC4_gCLcBGAs/s1600/8.jpg) 這邊直接點 `Next`。 ![](https://3.bp.blogspot.com/-lgQh-KmGtfk/WlA_raL_QHI/AAAAAAABAL4/lO7LU13I8WkU6Kn_7hvlnja_z87pixErgCLcBGAs/s1600/9.jpg) 點 `Next`。 ![](https://2.bp.blogspot.com/-l-JtPMKgcqQ/WlA_zFb87wI/AAAAAAABAL8/d_rGg9-KrQ0O_NwLbghI9yWMGlzA8c99QCLcBGAs/s1600/10.jpg) 安裝完成!點 `Close`。 然後什麼事也沒發生。所以我們剛剛安裝了什麼? # 試用 Heroku CLI 開啟一個小黑框,輸入 `heroku`。 ![](https://2.bp.blogspot.com/-_6OtfRCvaIE/WlBATAji7xI/AAAAAAABAME/jsb7EYULzkwagXZq3N_ycdfEec7zKz4ZwCLcBGAs/s1600/11.jpg) 如果你沒有看到這個畫面,那表示你可能在安裝的過程中遭遇到一些問題。或許可以考慮下載 `32-bit` 的安裝檔重裝一次看看。 這裡是指令教學,跟卡米狗教學差不多,不過不用看他的,看我的就好。 輸入 `heroku login` 作登入: ![](https://3.bp.blogspot.com/-uMDM9GVBLIM/WlBBnXAuykI/AAAAAAABAMU/wdNmCxd_NWMvnLOM3QX40RdvHuWIdrU-ACLcBGAs/s1600/13.jpg) 他說:「請輸入信箱:」 ![](https://4.bp.blogspot.com/-I22p54s7bwo/WlBCCdNI0HI/AAAAAAABAMg/VHojGxBMeuk5KJCuBTHucsRaW9QgUMH-wCLcBGAs/s1600/14.jpg) 他說:「請輸入密碼:」 ![](https://2.bp.blogspot.com/-2mYMsqbDBzs/WlBBJyYp-jI/AAAAAAABAMQ/h-GjGNxtUlM7VzOvd8QMIAImn7imBQRbgCLcBGAs/s1600/12.jpg) 他說:「登入成功。」 heroku 的初始設定到這裡就算完成了,接下來我們安裝 Git。 # 安裝 Git 點開這個網址:[https://git-scm.com/download/win](https://git-scm.com/download/win),沒意外的話點開就已經自動下載了。 ![](https://3.bp.blogspot.com/-G-mu1Y7PZJ8/WlBI4MV_iII/AAAAAAABAMw/nfKx76eJGQs6N2UeVjdoSBL4kh2l0xdxACLcBGAs/s1600/18.jpg) 要開始安裝了,安裝流程很長,注意看我選什麼,跟著選就對了。 ![](https://1.bp.blogspot.com/-EmSN6IcwceE/WlBJRfOZNkI/AAAAAAABAM4/Kh7aSQV0SYMOs9x00P1eHvxCi-D5YGGWACLcBGAs/s1600/16.jpg) 這是填安裝路徑,沒事不要亂改。 ![](https://1.bp.blogspot.com/-K9OkYCg3J2U/WlBJbluTLZI/AAAAAAABANA/fY2phRumMiE2C_oYnOx3Syex0TF0NQm6gCLcBGAs/s1600/17.jpg) ![](https://3.bp.blogspot.com/-qMJZ7dXkpWI/WlBJl40DeSI/AAAAAAABANE/kuNsAsYCpuoOb4fDWO5G2aI_Pzxn3neOQCLcBGAs/s1600/18.jpg) ![](https://3.bp.blogspot.com/-vWg95seJNU4/WlBJsBb8mhI/AAAAAAABANI/X3WWZvlEJZYpXXQ9PpiRlTdCaxgJxdhcACLcBGAs/s1600/19.jpg) ![](https://1.bp.blogspot.com/-g2-EljeQ9kE/WlBJy6qCxVI/AAAAAAABANM/y4ECx62mRtAfwQrt1t8T5e9x771aJ93gACLcBGAs/s1600/20.jpg) ![](https://1.bp.blogspot.com/-XnhpegyPUwg/WlBJ6M-j_6I/AAAAAAABANQ/Opr2G5GORNMtfwnkTrMUlmgK1vplUBiqQCLcBGAs/s1600/21.jpg) ![](https://4.bp.blogspot.com/-ZlnIz3vohgM/WlBKEcsO-OI/AAAAAAABANc/Ys0idL3Je9E9iWztcuQka_sGH1hPuC0GwCLcBGAs/s1600/22.jpg) ![](https://1.bp.blogspot.com/-BXCvQIXiN6M/WlBKJdFsTXI/AAAAAAABANg/5af0V09ZOl8EEOBpdIuFjh-7WrCMtI0RACLcBGAs/s1600/23.jpg) ![](https://1.bp.blogspot.com/-kOb3HM6hJbY/WlBKPvt6XuI/AAAAAAABANo/Vm1Y8OMDRCAB5Sgcl_Xq-ycURIgim1YagCLcBGAs/s1600/24.jpg) ![](https://2.bp.blogspot.com/-xptZJwuyjz0/WlBKf3nPW-I/AAAAAAABANw/9N2X5Oql8h4IdhDwNNgs4rXveKB2_mDfACLcBGAs/s1600/25.jpg) 跟 Heroku 一樣,這個安裝好之後要到小黑框才能用。 # 試用 Git 開啟一個小黑框,輸入 `git`。 ![](https://1.bp.blogspot.com/-z_iXYiJS-ps/WlBK3o99LBI/AAAAAAABAN4/fInwf5bqkjIzCZJ-jHcqU5ZeXnSWddohQCLcBGAs/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://1.bp.blogspot.com/-16ZsLczgKi8/WlBPY8TTcxI/AAAAAAABAOE/gqL4OACcqgwdquCnHaZOrf66nV9vynIPQCLcBGAs/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。」 今天就先到這裡,明天再講怎麼修。

沒有留言: