●前提
ローカルでは問題なく動作しています。
DBテーブル、カラムも存在を確認しました。
●実現したいこと
ローカルと同じように表示したいです。
●試したこと
heroku logs -tでログを確認しましたが解決策が見つからず、、、errorの対象
Completed 500 Internal Server Error in 10ms (ActiveRecord: 1.7ms | Allocations: 1035)
ActionView::Template::Error (PG::UndefinedColumn: ERROR: column posts.user_id does not exist 2019-10-01T10:02:22.350382+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = $1
表示したいソースコード
<div class="main user-show"> <div class="container"> <div class="user"> <img src="<%= "/user_images/#{@user.image_name}" %>"> <h2><%= @user.name %></h2> <!-- <p><%= @user.email %></p> --> <% if @user.id == @current_user.id %> <%= link_to("編集", "/users/#{@user.id}/edit") %> <% end %> </div> <ul class="user-tabs"> <li class="active"><%= link_to("投稿", "/users/#{@user.id}") %></li> <li><%= link_to("いいね!", "/users/#{@user.id}/likes") %></li> </ul> <% @user.posts.each do |post| %> <div class="posts-index-item"> <div class="post-left"> <img src="<%= "/user_images/#{post.user.image_name}" %>"> </div> <div class="post-right"> <div class="post-user-name"> <%= link_to(post.user.name, "/users/#{post.user.id}") %> </div> <%= link_to(post.content, "/posts/#{post.id}") %> </div> </div> <% end %> </div> </div>
WARNING
remote: ###### WARNING: remote: remote: You set your `config.assets.compile = true` in production. remote: This can negatively impact the performance of your application. remote: remote: For more information can be found in this article: remote: https://devcenter.heroku.com/articles/rails-asset-pipeline#compile-set-to-true-in-production remote: remote: remote: ###### WARNING: remote: remote: You set your `config.active_storage.service` to :local in production. remote: If you are uploading files to this app, they will not persist after the app remote: is restarted, on one-off dynos, or if the app has multiple dynos. remote: Heroku applications have an ephemeral file system. To remote: persist uploaded files, please use a service such as S3 and update your Rails remote: configuration. remote: remote: For more information can be found in this article: remote: https://devcenter.heroku.com/articles/active-storage-on-heroku remote: remote: remote: ###### WARNING: remote: remote: We detected that some binary dependencies required to remote: use all the preview features of Active Storage are not remote: present on this system. remote: remote: For more information please see: remote: https://devcenter.heroku.com/articles/active-storage-on-heroku remote: remote: remote: ###### WARNING: remote: remote: No Procfile detected, using the default web server. remote: We recommend explicitly declaring how to boot your server process via a Procfile. remote: https://devcenter.heroku.com/articles/ruby-default-web-server remote:
rails 6.0.0
dbローカル sqlite3
db本番 pg
丸投げになってしまうかもしれませんが何卒よろしくお願い致します。
追記情報あれば言ってください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/02 15:08
2019/10/02 15:10
2019/10/02 15:12
2019/10/02 15:48
2019/10/02 23:56
2019/10/03 05:24
2019/10/03 08:47
2019/10/03 09:32
2019/10/03 15:54