残念ですが、他に何を試していいのか分かりません。私はヒロクに私のレールアプリケーションをプッシュし、最後のプッシュの間、ページ(プロジェクト#インデックス)の1つがHerokuでこのエラーを返す以外はすべてうまくいった:Heroku - 残念ですが、何かが間違っていた - Herokuでのみ発生した問題がローカルではありません
申し訳ありませんが、何かが間違っていました。 アプリケーションの所有者は、ログで詳細を確認してください。
サーバーをローカルで実行してもクラウド9では同じことが起こりません。同じページが問題なく表示されます。
以前の回答を見ると、私が実行して試してみた:
heroku run rake db:migrate
私はまた、次のコマンドを実行して、再押し、すべてを試してみました:ここ
git push heroku
heroku pg:reset DATABASE
heroku run rails db:migrate
heroku run rails db:seed
heroku restart
は私のHerokuのログです:
2016-11-09T18:48:22.095610+00:00 app[web.1]: * Min threads: 0, max threads: 16
2016-11-09T18:48:22.095627+00:00 app[web.1]: * Environment: production
2016-11-09T18:48:22.096004+00:00 app[web.1]: Use Ctrl-C to stop
2016-11-09T18:48:22.095780+00:00 app[web.1]: * Listening on tcp://0.0.0.0:3666
2016-11-09T18:48:22.259703+00:00 heroku[web.1]: State changed from starting to up
2016-11-09T18:48:24.502298+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=2c6f6731-bedc-4367-83f9-f40a87273fe5 fwd="86.44.57.230" dyno=web.1 connect=0ms service=1402ms status=500 bytes=1669
2016-11-09T18:48:24.790630+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=4dae94ac-b865-4514-b59b-074591a69d05 fwd="86.44.57.230" dyno=web.1 connect=0ms service=2ms status=200 bytes=143
2016-11-09T18:49:18.903562+00:00 heroku[api]: Starting process with command `rails db:migrate` by [email protected]
2016-11-09T18:49:23.120484+00:00 heroku[run.7366]: Awaiting client
2016-11-09T18:49:23.143476+00:00 heroku[run.7366]: Starting process with command `rails db:migrate`
2016-11-09T18:49:23.302666+00:00 heroku[run.7366]: State changed from starting to up
2016-11-09T18:49:28.044047+00:00 heroku[run.7366]: State changed from up to complete
2016-11-09T18:49:28.029405+00:00 heroku[run.7366]: Process exited with status 0
2016-11-09T18:49:39.596513+00:00 heroku[api]: Starting process with command `rails db:seed` by [email protected]
2016-11-09T18:49:44.198548+00:00 heroku[run.3484]: Awaiting client
2016-11-09T18:49:44.246315+00:00 heroku[run.3484]: Starting process with command `rails db:seed`
2016-11-09T18:49:44.304728+00:00 heroku[run.3484]: State changed from starting to up
2016-11-09T18:49:50.403853+00:00 heroku[run.3484]: State changed from up to complete
2016-11-09T18:49:50.393367+00:00 heroku[run.3484]: Process exited with status 0
2016-11-09T18:50:11.659495+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=73beb6fe-90c6-41c9-8f75-e8939fd7a4be fwd="86.44.57.230" dyno=web.1 connect=0ms service=109ms status=500 bytes=1669
2016-11-09T18:50:11.861324+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=694b31e7-b3df-4c00-85fa-d931d6f3ba11 fwd="86.44.57.230" dyno=web.1 connect=0ms service=3ms status=200 bytes=143
2016-11-09T18:50:13.257178+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=0c7878ec-0017-48a2-a53d-55126ca12a97 fwd="86.44.57.230" dyno=web.1 connect=0ms service=28ms status=500 bytes=1669
2016-11-09T18:50:13.422750+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=8c44d51f-ca89-487b-ae25-eb06ef04735e fwd="86.44.57.230" dyno=web.1 connect=0ms service=4ms status=200 bytes=143
2016-11-09T18:50:25.482365+00:00 heroku[web.1]: Restarting
2016-11-09T18:50:25.483959+00:00 heroku[web.1]: State changed from up to starting
2016-11-09T18:50:28.492311+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-11-09T18:50:29.151373+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2016-11-09T18:50:29.151850+00:00 app[web.1]: === puma shutdown: 2016-11-09 18:50:29 +0000 ===
2016-11-09T18:50:29.151889+00:00 app[web.1]: - Goodbye!
2016-11-09T18:50:29.152378+00:00 app[web.1]: Exiting
2016-11-09T18:50:29.358836+00:00 heroku[web.1]: Process exited with status 0
2016-11-09T18:50:29.841404+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 22013 -e production`
2016-11-09T18:50:35.820996+00:00 app[web.1]: => Booting Puma
2016-11-09T18:50:35.821017+00:00 app[web.1]: => Rails 5.0.0.1 application starting in production on http://0.0.0.0:22013
2016-11-09T18:50:35.821018+00:00 app[web.1]: => Run `rails server -h` for more startup options
2016-11-09T18:50:37.033565+00:00 app[web.1]: Puma starting in single mode...
2016-11-09T18:50:37.033582+00:00 app[web.1]: * Version 3.4.0 (ruby 2.2.4-p230), codename: Owl Bowl Brawl
2016-11-09T18:50:37.033585+00:00 app[web.1]: * Min threads: 0, max threads: 16
2016-11-09T18:50:37.033617+00:00 app[web.1]: * Environment: production
2016-11-09T18:50:37.033865+00:00 app[web.1]: * Listening on tcp://0.0.0.0:22013
2016-11-09T18:50:37.034023+00:00 app[web.1]: Use Ctrl-C to stop
2016-11-09T18:50:37.177370+00:00 heroku[web.1]: State changed from starting to up
2016-11-09T18:50:37.930818+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=01420f22-76e1-4916-be34-e96e5db985df fwd="86.44.57.230" dyno=web.1 connect=0ms service=424ms status=500 bytes=1669
2016-11-09T18:50:38.121454+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=89d07228-0172-4809-8a43-241662cdfdcb fwd="86.44.57.230" dyno=web.1 connect=0ms service=4ms status=200 bytes=143
2016-11-09T18:52:12.082290+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by [email protected]
2016-11-09T18:52:18.172017+00:00 heroku[run.6086]: State changed from starting to up
2016-11-09T18:52:18.336471+00:00 heroku[run.6086]: Awaiting client
2016-11-09T18:52:18.372809+00:00 heroku[run.6086]: Starting process with command `bundle exec rake db:migrate`
2016-11-09T18:52:23.522954+00:00 heroku[run.6086]: State changed from up to complete
2016-11-09T18:52:23.513862+00:00 heroku[run.6086]: Process exited with status 0
2016-11-09T18:52:30.397822+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=8a1dc1d5-1f5b-425b-8deb-c0d60dbe15bb fwd="86.44.57.230" dyno=web.1 connect=0ms service=61ms status=500 bytes=1669
2016-11-09T18:52:30.602701+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=6105f2be-9c60-4d35-8ff2-cc4fcf7b438f fwd="86.44.57.230" dyno=web.1 connect=1ms service=1ms status=200 bytes=143
2016-11-09T18:52:32.824633+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=074d3fc0-9ad1-4c50-9325-139d392b502b fwd="86.44.57.230" dyno=web.1 connect=0ms service=40ms status=500 bytes=1669
2016-11-09T18:52:32.985752+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=f13fa5bf-5f2f-48f7-92eb-ff09beb5919d fwd="86.44.57.230" dyno=web.1 connect=0ms service=8ms status=200 bytes=143
2016-11-09T18:52:37.881288+00:00 heroku[router]: at=info method=GET path="/users" host=stark-falls-63733.herokuapp.com request_id=e3d2067c-b093-41e0-9d6f-72a68f172edf fwd="86.44.57.230" dyno=web.1 connect=0ms service=50ms status=200 bytes=3208
2016-11-09T18:52:42.036223+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=df869638-2c3a-40ac-b0a7-ba4a3190cdd6 fwd="86.44.57.230" dyno=web.1 connect=0ms service=17ms status=500 bytes=1669
2016-11-09T18:53:01.489311+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=dd949ce7-bfb1-422b-81fd-8ebc02540e71 fwd="86.44.57.230" dyno=web.1 connect=1ms service=71ms status=500 bytes=1669
2016-11-09T19:13:01.823684+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=62e72010-b749-4a8e-9f5d-3ee2550e4eb5 fwd="86.44.57.230" dyno=web.1 connect=0ms service=21ms status=500 bytes=1669
2016-11-09T19:24:19.274988+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by [email protected]
2016-11-09T19:24:25.388503+00:00 heroku[run.8672]: Awaiting client
2016-11-09T19:24:25.463637+00:00 heroku[run.8672]: Starting process with command `bundle exec rake db:migrate`
2016-11-09T19:24:25.535795+00:00 heroku[run.8672]: State changed from starting to up
2016-11-09T19:24:33.095488+00:00 heroku[run.8672]: Process exited with status 0
2016-11-09T19:24:33.081820+00:00 heroku[run.8672]: State changed from up to complete
2016-11-09T19:25:12.201241+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=529aeacd-e9b9-4b96-a2d7-34ddb5d3896e fwd="86.44.57.230" dyno=web.1 connect=0ms service=14ms status=500 bytes=1669
2016-11-09T19:25:12.469696+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=99e6fa84-47c2-4ae4-86cc-9f4e9f36ca16 fwd="86.44.57.230" dyno=web.1 connect=0ms service=2ms status=304 bytes=48
2016-11-09T19:28:30.885743+00:00 heroku[api]: Starting process with command `rails consoe` by [email protected]
2016-11-09T19:28:35.368273+00:00 heroku[run.7002]: Awaiting client
2016-11-09T19:28:35.393535+00:00 heroku[run.7002]: Starting process with command `rails consoe`
2016-11-09T19:28:35.539374+00:00 heroku[run.7002]: State changed from starting to up
2016-11-09T19:28:38.853885+00:00 heroku[run.7002]: State changed from up to complete
2016-11-09T19:28:38.878693+00:00 heroku[run.7002]: Process exited with status 1
2016-11-09T19:28:46.270972+00:00 heroku[api]: Starting process with command `rails console` by [email protected]
2016-11-09T19:28:51.734321+00:00 heroku[run.9640]: Awaiting client
2016-11-09T19:28:51.769438+00:00 heroku[run.9640]: Starting process with command `rails console`
2016-11-09T19:28:51.802682+00:00 heroku[run.9640]: State changed from starting to up
2016-11-09T19:29:03.378053+00:00 heroku[run.9640]: Process exited with status 0
2016-11-09T19:29:03.393812+00:00 heroku[run.9640]: State changed from up to complete
2016-11-09T19:29:16.843286+00:00 heroku[web.1]: Restarting
2016-11-09T19:29:16.843982+00:00 heroku[web.1]: State changed from up to starting
2016-11-09T19:29:20.220947+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-11-09T19:29:21.247977+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2016-11-09T19:29:21.248148+00:00 app[web.1]: === puma shutdown: 2016-11-09 19:29:21 +0000 ===
2016-11-09T19:29:21.248152+00:00 app[web.1]: - Goodbye!
2016-11-09T19:29:21.248232+00:00 app[web.1]: Exiting
2016-11-09T19:29:21.388099+00:00 heroku[web.1]: Process exited with status 0
2016-11-09T19:29:21.832713+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 21042 -e production`
2016-11-09T19:29:25.892825+00:00 app[web.1]: => Booting Puma
2016-11-09T19:29:25.892864+00:00 app[web.1]: => Rails 5.0.0.1 application starting in production on http://0.0.0.0:21042
2016-11-09T19:29:25.892865+00:00 app[web.1]: => Run `rails server -h` for more startup options
2016-11-09T19:29:26.922809+00:00 heroku[web.1]: State changed from starting to up
2016-11-09T19:29:26.844730+00:00 app[web.1]: Puma starting in single mode...
2016-11-09T19:29:26.844748+00:00 app[web.1]: * Version 3.4.0 (ruby 2.2.4-p230), codename: Owl Bowl Brawl
2016-11-09T19:29:26.844749+00:00 app[web.1]: * Min threads: 0, max threads: 16
2016-11-09T19:29:26.844750+00:00 app[web.1]: * Environment: production
2016-11-09T19:29:26.844827+00:00 app[web.1]: * Listening on tcp://0.0.0.0:21042
2016-11-09T19:29:26.845007+00:00 app[web.1]: Use Ctrl-C to stop
2016-11-09T19:29:28.618363+00:00 heroku[router]: at=info method=GET path="/projects" host=stark-falls-63733.herokuapp.com request_id=ae553309-c165-4526-b443-fd098df71c47 fwd="86.44.57.230" dyno=web.1 connect=1ms service=139ms status=500 bytes=1669
2016-11-09T19:29:28.754190+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=453d6e7f-b4e8-4337-9340-84cb8dcaa95f fwd="86.44.57.230" dyno=web.1 connect=1ms service=3ms status=200 bytes=143
2016-11-09T19:29:28.910252+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=79a6c43e-1ef3-4467-a60e-2c83d7ae0e83 fwd="86.44.57.230" dyno=web.1 connect=1ms service=2ms status=200 bytes=143
2016-11-09T19:29:30.017146+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=stark-falls-63733.herokuapp.com request_id=0dcba4a6-2113-437c-acb3-4383f16dd191 fwd="104.131.194.174" dyno=web.1 connect=0ms service=1ms status=200 bytes=143
これは私のインデックスビューです。
<% provide(:title, 'All Projects') %>
<h1>All Projects</h1>
<table>
<tbody>
<tr>
<td>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button"
data-toggle="dropdown">Filter by Team<span class="caret"></span></button>
<ul class="dropdown-menu">
<% Team.all.each do |team| %>
<li>
<%= link_to team.tName, projects_path(team: team.tName), class: "link" %>
</li>
<li class="<%= 'active' if params[:team] == team.tName %>">
<% end %>
</ul>
</div>
</td>
</tr>
<tr>
<td>
<div>
<button type="button" class="btn btn-default"><%= link_to "Remove Team Filters", projects_path, class: "link" %></button>
</div>
</td>
</tr>
</tbody>
</table>
<ul class="users">
<%= render 'projects/projectindex' %>
</ul>
そして、レンダリングされた部分は次のとおりです。
<% @projects.each do |project| %>
<h2><%= params[:team] %></h2>
<% if @projects.count == 0 %>
<h2>There are no projects currently in this category</h2>
<% end %>
<li>
Title: <%= project.title %><br>
Team: <%= project.team.tName%><br>
Description: <%= project.description %><br>
Status:<%= project.status %><br>
Type: <%= project.p_type %><br>
Updated: <%= time_ago_in_words(project.updated_at) %> ago.
</li>
<% end %>
任意のアイデア私は問題を解決することができますか?
ありがとうございます。
他のページは正常に動作しますが、この問題は 'projects#index'でのみ発生しますか? –
申し訳ありませんが、それを追加してください!はい、他のすべてが完璧に動作します。この問題は、プロジェクトの#indexとherokuでのみ発生します。 – Alessia
問題を示すエラーログは表示されていませんか?多分問題は 'project.team.tName'です。プロジェクトにチームがない場合、 'project.team'は_nil_を返し、' nil.tName'はnil: 'NilClass'の'未定義メソッド 'tNameを送出します。 –