masakikato1108
@masakikato1108 (MK)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

【質問です!】【Rails】【Heroku】デプロイするたび謝られてしまいます...。

解決したいこと

プログラミング初学者です。

Ruby on Rails 5.2で動画投稿アプリを作成しました。
AWS Cloud9上では問題なく動きます。

けれども、herokuにデプロイ出来ません...。
下記が出ます。

image.png

どなたか、解決方法を教えて下さいますでしょうか?!

発生している問題・エラー

ターミナルでログをみますと、

$heroku logs 

下記となります。

2020-10-13T02:30:37.979714+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=xxxx.herokuapp.com request_id=762c7ca8-678b-44a8-b0ca-cf0d579a1632 fwd="120.74.2.98" dyno=web.1 connect=1ms service=5ms status=500 bytes=1827 protocol=https

2020-10-13T02:30:38.237435+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=xxxx.herokuapp.com request_id=8d065b24-10ac-49c2-be51-fbd31830510e fwd="120.74.2.98" dyno=web.1 connect=1ms service=4ms status=304 bytes=48 protocol=https

status=500:Internal Server Errorのようですが、対処法が分かりません。
status=304:未更新。対処法が分かりません。

参照: [よく見るHTTPステータスコードをまとめてみました]
https://qiita.com/a24dai/items/73d6a7ae1f7ef45832ce)

該当するソースコード

routes.rb
Rails.application.routes.draw do
  root to: 'home#top'
  devise_for :users

  delete 'users/:id' =>'users#destroy'
  get 'home/greeting'=>'home#greeting'
  get 'home/how_to'=>'home#how_to'
  get 'contacts/new'=>'contacts#new'

  resource :user, except: [:new, :create, :destroy ]
  resources :contacts, only: [:new, :create ]
  resources :movies do
    resource :favorites, only: [:create, :destroy]
  end
end
app/controllers/movies/controller.rb
class MoviesController < ApplicationController
    before_action :authenticate_user!

    def index
        @movies= Movie.all.order(id: :DESC)
    end

    def show
        @movie = Movie.find(params[:id])
    end

    def new
        @movie = Movie.new
    end

    def create
        @movie = Movie.new(movie_params)
        @movie.user_id = current_user.id 
        if @movie.save
            redirect_to movie_path(@movie), notice: '投稿に成功しました。'
        else 
            render :new
        end
    end

    def edit
        @movie = Movie.find(params[:id])
        if @movie.user_id != current_user.id
            redirect_to movies_path, alert: '不正なアクセスです。'    
        end
    end

    def updated
        @movie = Movie.find(params[:id])
        if @movie.update(movie_params)
            redirect_to movie_path(@movie), notice: "更新に成功しました。"
        else
            render :edit
        end
    end

    def destroy
        movie = Movie.find(paramas[:id])
        movie.destroy
        redirect_to movies_path
    end

    private

    def movie_params
        params.require(:movie).permit(:name, :datetime, :place, :movie_url, :self_comment)
    end
end

app/views/layouts/application.html.erb
<!DOCTYPE html>
<html>
  <head>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>
    <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
    <script src="https://kit.fontawesome.com/6ec9fba7ef.js" crossorigin="anonymous"></script>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
  </head>

   <body>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
      <%= link_to '波 のりくらべ', root_path, class: "navbar-brand" %>
      <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#Navber" aria-controls="Navber" aria-expanded="false" aria-label="ナビゲーションの切替">
        <span class="navbar-toggler-icon"></span>
      </button>

      <% if user_signed_in? %>
        <div class="collapse navbar-collapse" id="Navber">
          <ul class="navbar-nav mr-auto">
            <li class="nav-item">
                <%= link_to '新規投稿', new_movie_path, class: "nav-link" %>
            </li>
            <li class="nav-item">
                <%= link_to '投稿一覧', movies_path, class: "nav-link" %>
            </li>
            <li class="nav-item">
              <%= link_to "ログアウト", destroy_user_session_path, method: :delete, class: "nav-link" %>
            </li>
      <% else %>
            <li class="nav-item">
              <%= link_to 'ログイン', new_user_session_path, class: "nav-link" %>
            </li>
            <li class="nav-item">
              <%= link_to '新規登録', new_user_registration_path, class: "nav-link" %>
            </li>
      <% end %>
            <li class="nav-item">
              <%= link_to 'ご挨拶', '/home/greeting', class: "nav-link" %>
            </li>
            <li class="nav-item">
                <%= link_to '投稿方法', '/home/how_to',  class: "nav-link" %>
            </li>
            <li class="nav-item">
              <%= link_to "お問い合わせ", new_contact_path, class: "nav-link" %>
            </li>
          </ul>
        </div>
    </nav>

    <% if flash[:notice] %>
      <div class="alert alert-primary" role="alert"><strong><%= notice %></strong></div>
    <% end %>
    <% if flash[:alert] %>
      <div class="alert alert-danger" role="alert"><strong><%= alert %></strong></div>
    <% end %>

    <div class= "main-contents">  
      <%= yield %>
    </div>

    <footer>
        <p><small class="text-muted">Copyright 2020 MTK Corp. All Rights Reserved.</small></p>
    </footer>
</html>
config/environments/development.rb
#上からここまで省略
config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address:              'smtp.gmail.com',
    port:                 587,
    domain:               'gmail.com',
    user_name:            'XXXX@gmail.com',
    password:             'XXXX', 
    authentication:       'plain',
    enable_starttls_auto: true
   }
 end

自分で試したこと

その1
$ heroku run rails db:migrate

結果:変わらず。
参照:【Rails】環境開発で出ない500エラーが本番環境で発生

その2
$ heroku addons:create heroku-postgresql:hobby-dev 
$ heroku run rails db:migrate

  
結果:変わらず。
参照:Heroku トラブル「We're sorry, but something went wrong」と言われたら

その3
$ heroku restart --app application_name
$ heroku restart web.1 --app application_name

結果:変わらず。
参照:HerokuでApplicationErrorが発生したときの対処法

以上、よろしくお願い致します!!
:bow::bow::bow:

0

4Answer

本番環境にアプリケーションをデプロイするのは苦労しますね。

すでにご存知かもしれませんが、問題の解決のために、一度整理しておいた方がいいことがひとつあります。
「We are sorry..」の画面は、Railsが「本番環境モード」のさいに、Rails内部で5xx関連のエラーが出たさいにRailsがデフォルトで返答する画面だということです。

開発環境上(今回はCloud9)では、そのようなエラーの際はRailsが発生源や詳細を画面に出力してくれますが、本番環境では一般のユーザーがそのような情報にアクセスできないよう、秘匿されているのです。

さて、そのさい、どうやってデバッグ(原因を特定)すればいいのかという話になりますが、コメントで書いている通り、「エラーがどの箇所で発生したか、ログを調べる」という作業が必要になります。

Railsが自動で出力してくれないため、自分で調べなければなりません。

本題に移りますが、今回の場合ですと、以下の記述が怪しそうです。
(申し訳ないですが、絶対にここが原因かはわかりません。)

2020-10-13T21:38:29.866151+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] Mysql2::Error (Unsupported charset: '"unicode"'):

上記のエラー文でググってみるとよいかもしれません。

「ここだ!」という箇所のエラー文を見つけて添付すれば、Railsに詳しい方なら一瞬で原因がわかるとは思いますので、ログを中心に調査することをおすすめします。

2Like

Comments

  1. @masakikato1108

    Questioner

    @wonder_meetさん、

    レクチャー&エラー可能性箇所のご指摘ありがとうございます!
    そうですね、ログをすべて送ってしまい、大変失礼しました。今後はエラーっぽい箇所を抜粋します。

    ご指摘のencoding、database. ymlに記述されていたunicodeをutmf8に変更しました。
    効果はあったと思います、ありがとうございます!

    【中間ご報告】
    下記DBまわりの修正もし、おかげさまで、デプロイは出来ました!
    しかし、本番環境では、動画投稿サイトなのに、投稿が出来ないアプリになってます、改善します。
    エラー点は下記のようです、これから調べます。

    [26d2c536-b50b-491c-bb1b-1c458a052d59] ActionController::RoutingError (No route matches [GET] "/js/bootstrap.min.js"):

    補足:encode以外に間違っていた点は私の認識でした。
    本番環境使用DBの認識違いです。

    使用してる教材では、開発環境で使ったmysqlを本番環境でも使うべく、"Clear DBアドオン"なるものを使う($heroku addons:add cleardbで導入)を推奨し、私もそうしていたためです。

    にも関わらず、修正はheroku公式が指定しているpostgresqlを使う前提でgemfileやdatabase.ymlの修正をしていたので、修正が出来ませんでした。

    以上となります。
    投稿が出来る投稿アプリにするべく、まずはググります!

    引き続きご指摘等ございましたら、投稿のほど、よろしくお願いいたします!!







  2. @masakikato1108

    Questioner

    下記を参考に、stylesheets/application.scssをいじりました。
    https://www.sejuku.net/blog/11043

    しかし、下記エラーがでます。本番環境での投稿が出来ない状況です。
    ActionController::RoutingError (No route matches [GET] "/js/bootstrap.min.js"):

    さらなるお知恵拝借ができればありがたいです。
    ご多忙のところ大変恐縮ですが、可能であれば見ていただけますとありがたいです!!
  3. 進展したようでよかったです。
    エラー文については、貼っていただいた量で問題なかったですよ。少なすぎるよりは、多すぎるほうが手がかりになるので、そういう意味では多いほうが望ましいです。

    -------

    本題ですが、貼っていただいたエラー文をぐぐってみると、以下の記事が参考になりそうでした。(英語ですが…)

    https://stackoverflow.com/questions/20466428/actioncontrollerroutingerror-no-route-matches-get-members-js-bootstrap-mi

    一部だけかいつまむと、<script src="/js/bootstrap.min.js">を、<script src="/assets/bootstrap.min.js">するとよい、なぜなら本番環境ではCSSやJSファイルは開発環境とは異なり、/assets配下に配置されるから

    というようなことを言っている記事のように見えます。(他にも内容があったので、訳して記事を読むと参考になるかもしれません)

  4. @masakikato1108

    Questioner

    ありがとうございます!

    さっそく/assetsに変更しましたが、変化ありませんでした。
    ログの中にエラーが見れます。

    ActionController::RoutingError (No route matches [GET] "/assets/bootstrap.min.css"):

    あっ、下記新参エラーも現れました!

    ActionView::Template::Error (undefined method `movie_url' for #<Movie:0x00007f29380687a0>

    上記2点をググって方策さがします!

    すべてのログは下記です。
    (マークダウンされないでしょうから、見にくくて申し訳ありません!)

    ```ruby
    › Warning: heroku update available from 7.42.5 to 7.45.0.
    2020-10-15T08:32:17.598468+00:00 app[web.1]: [059d81d2-5072-4280-88e5-e0fb9cba0914] app/views/movies/_form.html.erb:20:in `block in _app_views_movies__form_html_erb___1166493164119203641_69909833669400'
    2020-10-15T08:32:17.598469+00:00 app[web.1]: [059d81d2-5072-4280-88e5-e0fb9cba0914] app/views/movies/_form.html.erb:2:in `_app_views_movies__form_html_erb___1166493164119203641_69909833669400'
    2020-10-15T08:32:17.598469+00:00 app[web.1]: [059d81d2-5072-4280-88e5-e0fb9cba0914] app/views/movies/new.html.erb:7:in `_app_views_movies_new_html_erb__2644049779602101661_69909833636900'
    2020-10-15T08:32:17.601068+00:00 heroku[router]: at=info method=GET path="/movies/new" host=meiji-hai2020.herokuapp.com request_id=059d81d2-5072-4280-88e5-e0fb9cba0914 fwd="120.74.2.98" dyno=web.1 connect=1ms service=24ms status=500 bytes=1827 protocol=https
    2020-10-15T08:32:17.609954+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=meiji-hai2020.herokuapp.com request_id=8b2a8cb6-fd97-432a-9f75-9eec982c6d87 fwd="120.74.2.98" dyno=web.1 connect=1ms service=1ms status=304 bytes=48 protocol=https
    2020-10-15T08:40:19.000000+00:00 app[api]: Build started by user XXXX@gmail.com
    2020-10-15T08:40:48.112679+00:00 app[api]: Release v20 created by user XXXX@gmail.com
    2020-10-15T08:40:48.112679+00:00 app[api]: Deploy 404b88a8 by user XXXX@gmail.com
    2020-10-15T08:40:48.465201+00:00 heroku[web.1]: Restarting
    2020-10-15T08:40:48.467040+00:00 heroku[web.1]: State changed from up to starting
    2020-10-15T08:40:49.573316+00:00 heroku[web.1]: Stopping all processes with SIGTERM
    2020-10-15T08:40:49.605458+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
    2020-10-15T08:40:49.607578+00:00 app[web.1]: === puma shutdown: 2020-10-15 08:40:49 +0000 ===
    2020-10-15T08:40:49.607581+00:00 app[web.1]: - Goodbye!
    2020-10-15T08:40:49.607683+00:00 app[web.1]: Exiting
    2020-10-15T08:40:49.679236+00:00 heroku[web.1]: Process exited with status 143
    2020-10-15T08:40:54.331518+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
    2020-10-15T08:40:57.000000+00:00 app[api]: Build succeeded
    2020-10-15T08:40:59.454331+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bootstrap-sass-3.3.7/lib/bootstrap-sass/version.rb:2: warning: already initialized constant Bootstrap::VERSION
    2020-10-15T08:40:59.454474+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bootstrap-4.4.1/lib/bootstrap/version.rb:4: warning: previous definition of VERSION was here
    2020-10-15T08:40:59.454475+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bootstrap-sass-3.3.7/lib/bootstrap-sass/version.rb:3: warning: already initialized constant Bootstrap::BOOTSTRAP_SHA
    2020-10-15T08:40:59.454485+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bootstrap-4.4.1/lib/bootstrap/version.rb:5: warning: previous definition of BOOTSTRAP_SHA was here
    2020-10-15T08:40:59.467859+00:00 app[web.1]: => Booting Puma
    2020-10-15T08:40:59.467910+00:00 app[web.1]: => Rails 5.2.4.4 application starting in production
    2020-10-15T08:40:59.467932+00:00 app[web.1]: => Run `rails server -h` for more startup options
    2020-10-15T08:41:01.011342+00:00 app[web.1]: Puma starting in single mode...
    2020-10-15T08:41:01.011392+00:00 app[web.1]: * Version 3.12.6 (ruby 2.5.1-p57), codename: Llamas in Pajamas
    2020-10-15T08:41:01.011393+00:00 app[web.1]: * Min threads: 5, max threads: 5
    2020-10-15T08:41:01.011394+00:00 app[web.1]: * Environment: production
    2020-10-15T08:41:01.011559+00:00 app[web.1]: * Listening on tcp://0.0.0.0:29743
    2020-10-15T08:41:01.011673+00:00 app[web.1]: Use Ctrl-C to stop
    2020-10-15T08:41:01.579097+00:00 heroku[web.1]: State changed from starting to up
    2020-10-15T08:41:08.116676+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] Started GET "/users/sign_in" for 120.74.2.98 at 2020-10-15 08:41:08 +0000
    2020-10-15T08:41:08.118358+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] Processing by Devise::SessionsController#new as HTML
    2020-10-15T08:41:08.188086+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] (2.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
    2020-10-15T08:41:08.213574+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] User Load (2.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
    2020-10-15T08:41:08.254578+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=meiji-hai2020.herokuapp.com request_id=a4fa61e6-b6d0-451f-a6be-43d92713da83 fwd="120.74.2.98" dyno=web.1 connect=0ms service=147ms status=302 bytes=1048 protocol=https
    2020-10-15T08:41:08.254927+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] Redirected to https://meiji-hai2020.herokuapp.com/user
    2020-10-15T08:41:08.255060+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] Filter chain halted as :require_no_authentication rendered or redirected
    2020-10-15T08:41:08.256172+00:00 app[web.1]: [a4fa61e6-b6d0-451f-a6be-43d92713da83] Completed 302 Found in 137ms (ActiveRecord: 15.3ms)
    2020-10-15T08:41:08.449031+00:00 app[web.1]: [02f515e2-8afa-437d-8996-f07053ad9813] Started GET "/user" for 120.74.2.98 at 2020-10-15 08:41:08 +0000
    2020-10-15T08:41:08.450204+00:00 app[web.1]: [02f515e2-8afa-437d-8996-f07053ad9813] Processing by UsersController#show as HTML
    2020-10-15T08:41:08.456668+00:00 app[web.1]: [02f515e2-8afa-437d-8996-f07053ad9813] User Load (2.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
    2020-10-15T08:41:08.459063+00:00 app[web.1]: [02f515e2-8afa-437d-8996-f07053ad9813] Rendering users/show.html.erb within layouts/application
    2020-10-15T08:41:08.460175+00:00 app[web.1]: [02f515e2-8afa-437d-8996-f07053ad9813] Rendered users/show.html.erb within layouts/application (1.0ms)
    2020-10-15T08:41:08.464453+00:00 app[web.1]: [02f515e2-8afa-437d-8996-f07053ad9813] Completed 200 OK in 14ms (Views: 6.3ms | ActiveRecord: 2.2ms)
    2020-10-15T08:41:08.465260+00:00 heroku[router]: at=info method=GET path="/user" host=meiji-hai2020.herokuapp.com request_id=02f515e2-8afa-437d-8996-f07053ad9813 fwd="120.74.2.98" dyno=web.1 connect=0ms service=26ms status=200 bytes=3905 protocol=https
    2020-10-15T08:41:08.743410+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] Started GET "/assets/bootstrap.min.css" for 120.74.2.98 at 2020-10-15 08:41:08 +0000
    2020-10-15T08:41:08.845687+00:00 app[web.1]: [fe16945f-328b-44c3-9686-6a2abd4a4988] Started GET "/assets/bootstrap.min.js" for 120.74.2.98 at 2020-10-15 08:41:08 +0000
    2020-10-15T08:41:09.280531+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430]
    2020-10-15T08:41:09.280897+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] ActionController::RoutingError (No route matches [GET] "/assets/bootstrap.min.css"):
    2020-10-15T08:41:09.281160+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430]
    2020-10-15T08:41:09.281241+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
    2020-10-15T08:41:09.281242+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
    2020-10-15T08:41:09.281242+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:38:in `call_app'
    2020-10-15T08:41:09.281243+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in `block in call'
    2020-10-15T08:41:09.281244+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `block in tagged'
    2020-10-15T08:41:09.281244+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:28:in `tagged'
    2020-10-15T08:41:09.281245+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `tagged'
    2020-10-15T08:41:09.281245+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in `call'
    2020-10-15T08:41:09.281246+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
    2020-10-15T08:41:09.281246+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/request_id.rb:27:in `call'
    2020-10-15T08:41:09.281247+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
    2020-10-15T08:41:09.281247+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
    2020-10-15T08:41:09.281248+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
    2020-10-15T08:41:09.281249+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/executor.rb:14:in `call'
    2020-10-15T08:41:09.281249+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/static.rb:127:in `call'
    2020-10-15T08:41:09.281250+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
    2020-10-15T08:41:09.281250+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/engine.rb:524:in `call'
    2020-10-15T08:41:09.281250+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/configuration.rb:227:in `call'
    2020-10-15T08:41:09.281251+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/server.rb:706:in `handle_request'
    2020-10-15T08:41:09.281251+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/server.rb:476:in `process_client'
    2020-10-15T08:41:09.281252+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/server.rb:334:in `block in run'
    2020-10-15T08:41:09.281252+00:00 app[web.1]: [7eaee81f-55e1-4d48-91ca-f59f4e6e3430] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/thread_pool.rb:135:in `block in spawn_thread'
    2020-10-15T08:41:09.283993+00:00 heroku[router]: at=info method=GET path="/assets/bootstrap.min.css" host=meiji-hai2020.herokuapp.com request_id=7eaee81f-55e1-4d48-91ca-f59f4e6e3430 fwd="120.74.2.98" dyno=web.1 connect=0ms service=549ms status=404 bytes=1902 protocol=https
    2020-10-15T08:41:12.252374+00:00 heroku[router]: at=info method=GET path="/assets/bootstrap.min.js" host=meiji-hai2020.herokuapp.com request_id=fe16945f-328b-44c3-9686-6a2abd4a4988 fwd="120.74.2.98" dyno=web.1 connect=1ms service=3520ms status=304 bytes=258 protocol=https
    2020-10-15T08:41:12.625951+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=meiji-hai2020.herokuapp.com request_id=797f695a-7156-4c63-a499-d34e3c604f2d fwd="120.74.2.98" dyno=web.1 connect=0ms service=6ms status=200 bytes=143 protocol=https
    2020-10-15T08:41:15.227118+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Started GET "/movies/new" for 120.74.2.98 at 2020-10-15 08:41:15 +0000
    2020-10-15T08:41:15.228778+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Processing by MoviesController#new as HTML
    2020-10-15T08:41:15.237787+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] User Load (4.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
    2020-10-15T08:41:15.271902+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Rendering movies/new.html.erb within layouts/application
    2020-10-15T08:41:15.274293+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Rendered movies/_error.html.erb (0.9ms)
    2020-10-15T08:41:15.286141+00:00 heroku[router]: at=info method=GET path="/movies/new" host=meiji-hai2020.herokuapp.com request_id=c599edad-4717-4647-964d-5f75b0904475 fwd="120.74.2.98" dyno=web.1 connect=1ms service=68ms status=500 bytes=1827 protocol=https
    2020-10-15T08:41:15.289315+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Rendered movies/_form.html.erb (14.3ms)
    2020-10-15T08:41:15.289420+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Rendered movies/new.html.erb within layouts/application (17.4ms)
    2020-10-15T08:41:15.289761+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] Completed 500 Internal Server Error in 61ms (ActiveRecord: 11.9ms)
    2020-10-15T08:41:15.290498+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475]
    2020-10-15T08:41:15.290505+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] ActionView::Template::Error (undefined method `movie_url' for #<Movie:0x00007f29380687a0>
    2020-10-15T08:41:15.290506+00:00 app[web.1]: Did you mean? movie_was):
    2020-10-15T08:41:15.290638+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 17:
    2020-10-15T08:41:15.290639+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 18: <div class='form-group'>
    2020-10-15T08:41:15.290640+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 19: <label>YouTube URL (下11桁)</label>
    2020-10-15T08:41:15.290641+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 20: <%=f.text_field :movie_url, class: 'form-control'%>
    2020-10-15T08:41:15.290641+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 21: </div>
    2020-10-15T08:41:15.290641+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 22:
    2020-10-15T08:41:15.290642+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] 23: <div class='form-group'>
    2020-10-15T08:41:15.290647+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475]
    2020-10-15T08:41:15.290691+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] app/views/movies/_form.html.erb:20:in `block in _app_views_movies__form_html_erb___2435341113810719731_69907505662960'
    2020-10-15T08:41:15.290692+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] app/views/movies/_form.html.erb:2:in `_app_views_movies__form_html_erb___2435341113810719731_69907505662960'
    2020-10-15T08:41:15.290692+00:00 app[web.1]: [c599edad-4717-4647-964d-5f75b0904475] app/views/movies/new.html.erb:7:in `_app_views_movies_new_html_erb___870401338760093264_69907505618100'
    ```


  5. @masakikato1108

    Questioner

    【さらなる中間報告/本番環境で投稿出来ない問題に関して】

    おかげさまで、一歩前進いたしました。
    現状:投稿ボタンから投稿フォームまで遷移できました。
    しかし、Sendボタン押すとエラーになります。もう一踏ん張りです。

    (やったこと)
    データーベースに問題あるのでは?との指摘受け、下記を実行しました。

    rails db drop

    rails db create

    rails db migrate

    以上になります。

@woxtuさん、さっそくのお返事・ご指摘、ありがとうございます!!

1. メルアド・パスワード、XXXXとしました!

2. 教えて頂いた下記をconfig/environments/production.rbに記述しました。

rails_12factor は消去すると$ git push heroku masterがエラーになるので残しました。

# config/environments/production.rb
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

if ENV["RAILS_LOG_TO_STDOUT"].present?
  logger           = ActiveSupport::Logger.new(STDOUT)
  logger.formatter = config.log_formatter
  config.logger = ActiveSupport::TaggedLogging.new(logger)
end

3. $ heroku logs の結果は下記です。全部抜粋します。

2を行った結果:status=302の出現場所が上に移動する変化がでました。
デプロイは出来ません。herokuからはwe're sorry... の表示のまま。

なにか更なるヒントはありましたら、ご連絡いただけますとありがたいです!!
私もGetting Started on Heroku with Rails 5.xを解読してみます!

    Warning: heroku update available from 7.42.5 to 7.45.0.
2020-10-13T21:38:27.262393+00:00 app[web.1]: * Environment: production
2020-10-13T21:38:27.262585+00:00 app[web.1]: * Listening on tcp://0.0.0.0:20139
2020-10-13T21:38:27.262759+00:00 app[web.1]: Use Ctrl-C to stop
2020-10-13T21:38:27.460440+00:00 heroku[web.1]: State changed from starting to up
2020-10-13T21:38:29.623476+00:00 app[web.1]: [52bcd1d9-8615-4ec6-ac38-07d48e45843e] Started GET "/" for 120.74.2.98 at 2020-10-13 21:38:29 +0000
2020-10-13T21:38:29.624837+00:00 app[web.1]: [52bcd1d9-8615-4ec6-ac38-07d48e45843e] Processing by HomeController#top as HTML
2020-10-13T21:38:29.637431+00:00 app[web.1]: [52bcd1d9-8615-4ec6-ac38-07d48e45843e] Completed 401 Unauthorized in 12ms
2020-10-13T21:38:29.661433+00:00 heroku[router]: at=info method=GET path="/" host=meiji-hai2020.herokuapp.com request_id=52bcd1d9-8615-4ec6-ac38-07d48e45843e fwd="120.74.2.98" dyno=web.1 connect=1ms service=44ms status=302 bytes=722 protocol=https
2020-10-13T21:38:29.857080+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] Started GET "/users/sign_in" for 120.74.2.98 at 2020-10-13 21:38:29 +0000
2020-10-13T21:38:29.858491+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] Processing by Devise::SessionsController#new as HTML
2020-10-13T21:38:29.864490+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] Completed 500 Internal Server Error in 3ms
2020-10-13T21:38:29.866054+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2]
2020-10-13T21:38:29.866151+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] Mysql2::Error (Unsupported charset: '"unicode"'):
2020-10-13T21:38:29.866215+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2]
2020-10-13T21:38:29.866394+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:47:in `charset_name='
2020-10-13T21:38:29.866395+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:47:in `initialize'
2020-10-13T21:38:29.866403+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new'
2020-10-13T21:38:29.866407+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `mysql2_connection'
2020-10-13T21:38:29.866408+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection'
2020-10-13T21:38:29.866408+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection'
2020-10-13T21:38:29.866410+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection'
2020-10-13T21:38:29.866410+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection'
2020-10-13T21:38:29.866411+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout'
2020-10-13T21:38:29.866411+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection'
2020-10-13T21:38:29.866412+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection'
2020-10-13T21:38:29.866412+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_handling.rb:118:in `retrieve_connection'
2020-10-13T21:38:29.866412+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_handling.rb:90:in `connection'
2020-10-13T21:38:29.866413+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/model_schema.rb:466:in `load_schema!'
2020-10-13T21:38:29.866418+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/attributes.rb:234:in `load_schema!'
2020-10-13T21:38:29.866419+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/attribute_decorators.rb:51:in `load_schema!'
2020-10-13T21:38:29.866419+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/model_schema.rb:459:in `block in load_schema'
2020-10-13T21:38:29.866420+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/ruby-2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
2020-10-13T21:38:29.866420+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/model_schema.rb:456:in `load_schema'
2020-10-13T21:38:29.866420+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/model_schema.rb:346:in `attribute_types'
2020-10-13T21:38:29.866421+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/attribute_methods.rb:230:in `has_attribute?'
2020-10-13T21:38:29.866421+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/inheritance.rb:55:in `new'
2020-10-13T21:38:29.866422+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/devise-4.7.3/app/controllers/devise/sessions_controller.rb:11:in `new'
2020-10-13T21:38:29.866422+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
2020-10-13T21:38:29.866423+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:194:in `process_action'
2020-10-13T21:38:29.866423+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
2020-10-13T21:38:29.866429+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
2020-10-13T21:38:29.866429+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:132:in `run_callbacks'
2020-10-13T21:38:29.866430+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:41:in `process_action'
2020-10-13T21:38:29.866430+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/rescue.rb:22:in `process_action'
2020-10-13T21:38:29.866430+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
2020-10-13T21:38:29.866431+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in `block in instrument'
2020-10-13T21:38:29.866431+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
2020-10-13T21:38:29.866431+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in `instrument'
2020-10-13T21:38:29.866432+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
2020-10-13T21:38:29.866432+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
2020-10-13T21:38:29.866432+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
2020-10-13T21:38:29.866433+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:134:in `process'
2020-10-13T21:38:29.866434+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionview-5.2.4.4/lib/action_view/rendering.rb:32:in `process'
2020-10-13T21:38:29.866434+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:191:in `dispatch'
2020-10-13T21:38:29.866435+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:252:in `dispatch'
2020-10-13T21:38:29.866435+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
2020-10-13T21:38:29.866435+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:34:in `serve'
2020-10-13T21:38:29.866436+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
2020-10-13T21:38:29.866436+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/mapper.rb:48:in `serve'
2020-10-13T21:38:29.866437+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:52:in `block in serve'
2020-10-13T21:38:29.866437+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in `each'
2020-10-13T21:38:29.866438+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in `serve'
2020-10-13T21:38:29.866438+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:840:in `call'
2020-10-13T21:38:29.866439+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call'
2020-10-13T21:38:29.866439+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch'
2020-10-13T21:38:29.866440+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call'
2020-10-13T21:38:29.866440+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
2020-10-13T21:38:29.866441+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
2020-10-13T21:38:29.866446+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:in `call'
2020-10-13T21:38:29.866446+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
2020-10-13T21:38:29.866447+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
2020-10-13T21:38:29.866447+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
2020-10-13T21:38:29.866448+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
2020-10-13T21:38:29.866448+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/cookies.rb:670:in `call'
2020-10-13T21:38:29.866448+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2020-10-13T21:38:29.866449+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:98:in `run_callbacks'
2020-10-13T21:38:29.866449+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
2020-10-13T21:38:29.866449+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
2020-10-13T21:38:29.866450+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
2020-10-13T21:38:29.866450+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:38:in `call_app'
2020-10-13T21:38:29.866451+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in `block in call'
2020-10-13T21:38:29.866451+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `block in tagged'
2020-10-13T21:38:29.866452+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:28:in `tagged'
2020-10-13T21:38:29.866452+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `tagged'
2020-10-13T21:38:29.866453+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in `call'
2020-10-13T21:38:29.866453+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
2020-10-13T21:38:29.866453+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/request_id.rb:27:in `call'
2020-10-13T21:38:29.866454+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
2020-10-13T21:38:29.866454+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
2020-10-13T21:38:29.866455+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
2020-10-13T21:38:29.866455+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/executor.rb:14:in `call'
2020-10-13T21:38:29.866462+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/static.rb:127:in `call'
2020-10-13T21:38:29.866463+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
2020-10-13T21:38:29.866463+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/engine.rb:524:in `call'
2020-10-13T21:38:29.866464+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/configuration.rb:227:in `call'
2020-10-13T21:38:29.866464+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/server.rb:706:in `handle_request'
2020-10-13T21:38:29.866465+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/server.rb:476:in `process_client'
2020-10-13T21:38:29.866465+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/server.rb:334:in `block in run'
2020-10-13T21:38:29.866470+00:00 app[web.1]: [bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2] vendor/bundle/ruby/2.5.0/gems/puma-3.12.6/lib/puma/thread_pool.rb:135:in `block in spawn_thread'
2020-10-13T21:38:29.870019+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=meiji-hai2020.herokuapp.com request_id=bc1a1b2d-ee29-4f7e-affa-8c3260eebfd2 fwd="120.74.2.98" dyno=web.1 connect=2ms service=19ms status=500 bytes=1827 protocol=https
0Like

@woxtu さん、
@wonder_meet さん、
ご協力ありがとうございました。

おかげさまでHeroku デプロイと本番環境での新規投稿ができるようになりました!
結果ご報告いたします。

【デプロイ出来なかった原因】
・開発環境と本番環境のデータベースに記載されたコラム名が異なっていた。

【原因(推定)】
マイグレーションを合計19回行った後にデプロイした。
その結果どうやら、開発環境と本番環境でのコラム名の相違が発生し、Herokuにてエラーとなった。

【やったこと】
1.開発環境でのデータベースをいったん消去して再度作成。

$ rails db:drop
$ rails db:create
$ rails db:migrate

参照:https://qiita.com/parsetree/items/e9b08c6b11f762b949de

2.Herokuにデプロイしたアプリをいったん消去し、再度デプロイ。

【まなび】
・データーベース設計は慎重に行う。
・本番環境では開発環境のデーターベースが完全に反映しないことがあるようだ。
*開発環境はphpMyAdminでデーターベース内容確認した。しかしデプロイ後に使用したSequel Proで確認するとなぜかコラム名が異なっていた。

*初学ゆえ、間違ったことを書いている可能性があります。
その際はご指摘いただけますと非常にありがたいです。

以上となります。

0Like

Your answer might help someone💌