我试图从heroku进入我的应用程序的另一个页面,但我不能,因为它说“我们很抱歉,但出了点问题。”
这是我的heroku日志中的内容
2014-02-13T18:58:20.617640+00:00 heroku[router]: at=info method=GET path=/ host=whispering-shore-8429.herokuapp.com request_id=0ea
ebe7-bea5-417b-b371-462a071c2f45 fwd="68.55.131.71" dyno=web.1 connect=1ms service=229ms status=304 bytes=0
2014-02-13T18:58:20.762361+00:00 heroku[router]: at=info method=GET path=/assets/application-ec238357b2bb2d82a5fd2c7675f7d5ea.css
ost=whispering-shore-8429.herokuapp.com request_id=4de97dca-391d-4181-a4fa-f2c0fdeb2203 fwd="68.55.131.71" dyno=web.1 connect=1ms
ervice=9ms status=304 bytes=0
2014-02-13T19:02:22.251866+00:00 app[web.1]: Started GET "/live_players" for 68.55.131.71 at 2014-02-13 19:02:22 +0000
2014-02-13T19:02:22.253790+00:00 app[web.1]: Processing by LivePlayersController#index as HTML
2014-02-13T19:02:22.251866+00:00 app[web.1]: Started GET "/live_players" for 68.55.131.71 at 2014-02-13 19:02:22 +0000
2014-02-13T19:02:22.253790+00:00 app[web.1]: Processing by LivePlayersController#index as HTML
2014-02-13T19:02:26.441393+00:00 app[web.1]: PG::Error: ERROR: column "team" does not exist
2014-02-13T19:02:26.441393+00:00 app[web.1]: LINE 1: SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T19:02:26.441393+00:00 app[web.1]: ^
2014-02-13T19:02:26.441393+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T19:02:26.441393+00:00 app[web.1]: LINE 1: SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T19:02:26.441393+00:00 app[web.1]: PG::Error: ERROR: column "team" does not exist
2014-02-13T19:02:26.453212+00:00 app[web.1]: Rendered live_players/index.html.erb within layouts/application (18.3ms)
2014-02-13T19:02:26.455611+00:00 app[web.1]:
2014-02-13T19:02:26.441393+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T19:02:26.455611+00:00 app[web.1]: ActionView::Template::Error (PG::Error: ERROR: column "team" does not exist
2014-02-13T19:02:26.453456+00:00 app[web.1]: Completed 500 Internal Server Error in 4200ms
2014-02-13T19:02:26.453456+00:00 app[web.1]: Completed 500 Internal Server Error in 4200ms
2014-02-13T19:02:26.453212+00:00 app[web.1]: Rendered live_players/index.html.erb within layouts/application (18.3ms)
2014-02-13T19:02:26.455611+00:00 app[web.1]: ^
2014-02-13T19:02:26.441393+00:00 app[web.1]: ^
2014-02-13T19:02:26.455611+00:00 app[web.1]: LINE 1: SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T19:02:26.455800+00:00 app[web.1]: 11: <% end %>
2014-02-13T19:02:26.455611+00:00 app[web.1]: 10: <option><%= abbrv.Team %></option>
2014-02-13T19:02:26.455611+00:00 app[web.1]: 9: <% Abbrv.order("Team").each do |abbrv| %>
2014-02-13T19:02:26.455800+00:00 app[web.1]: 12: </select>
2014-02-13T19:02:26.455800+00:00 app[web.1]:
2014-02-13T19:02:26.455611+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team):
2014-02-13T19:02:26.455611+00:00 app[web.1]: 6:
2014-02-13T19:02:26.455800+00:00 app[web.1]: app/views/live_players/index.html.erb:9:in `_app_views_live_players_index_html_erb_
_2359354532860974770_70257406404860'
2014-02-13T19:02:26.455611+00:00 app[web.1]: 7: <select id = "FilterTm">
2014-02-13T19:02:26.455611+00:00 app[web.1]: 8: <option>Select a Team...</option>
2014-02-13T19:02:26.455800+00:00 app[web.1]: ActionView::Template::Error (PG::Error: ERROR: column "team" does not exist
2014-02-13T19:02:26.455800+00:00 app[web.1]: ^
2014-02-13T19:02:26.455800+00:00 app[web.1]:
2014-02-13T19:02:26.455800+00:00 app[web.1]:
2014-02-13T19:02:26.455976+00:00 app[web.1]: 7: <select id = "FilterTm">
2014-02-13T19:02:26.455976+00:00 app[web.1]: 6:
2014-02-13T19:02:26.455976+00:00 app[web.1]: 11: <% end %>
2014-02-13T19:02:26.455976+00:00 app[web.1]: 12: </select>
2014-02-13T19:02:26.455976+00:00 app[web.1]:
2014-02-13T19:02:26.455976+00:00 app[web.1]:
2014-02-13T19:02:26.455800+00:00 app[web.1]: LINE 1: SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T19:02:26.455976+00:00 app[web.1]: app/views/live_players/index.html.erb:9:in `_app_views_live_players_index_html_erb_
_2359354532860974770_70257406404860'
2014-02-13T19:02:26.455800+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team):
2014-02-13T19:02:26.455976+00:00 app[web.1]: 9: <% Abbrv.order("Team").each do |abbrv| %>
2014-02-13T19:02:26.455976+00:00 app[web.1]: 8: <option>Select a Team...</option>
2014-02-13T19:02:26.455976+00:00 app[web.1]: 10: <option><%= abbrv.Team %></option>
现在我注意到,列'团队'不存在,但事实并非如此。这是我的页面:
<h1>Listing All Players</h1>
<div id="progressbar"><div class="progress-label">Loading...</div></div>
<a id="playerBtn"><button type="button" id="plyrBtn">Players</button></a>
<select id = "FilterTm">
<option>Select a Team...</option>
<% Abbrv.order("Team").each do |abbrv| %>
<option><%= abbrv.Team %></option>
<% end %>
</select>
<%#= link_to '<button type = "button">Players</button>'.html_safe, live_players_path(:Team => @tmf) %>
<br />
<br />
<input type="text" class="hiddenField" id="curTeam" style="border:none;" />
<select id = "ptable" size = 30>
<% @live_players.each do |live_player| %>
<option><%= live_player.Plyr %></option>
<% end %>
</select>
这是它试图获得的页面。现在这是我的路线文件:
TestfflApp::Application.routes.draw do
root "static_pages#home"
get "static_pages/Add_team"
resources :teamplayers
resources :fteams
resources :abbrvs
resources :live_players
get 'live_players', to: 'live_players#index' << Routed page
所以我在这里看了一下并完成了与此类似的问题的所有建议,所以我有什么问题?
更新
以下是heroku日志现在所说的内容:
`2014-02-13T20:37:48.237162+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-02-13T20:37:56.719387+00:00 app[web.1]: Processing by LivePlayersController#index as HTML
2014-02-13T20:37:56.717608+00:00 app[web.1]: Started GET "/live_players" for 68.55.131.71 at 2014-02-13 20:37:56 +0000
2014-02-13T20:37:56.717608+00:00 app[web.1]: Started GET "/live_players" for 68.55.131.71 at 2014-02-13 20:37:56 +0000
2014-02-13T20:37:56.719387+00:00 app[web.1]: Processing by LivePlayersController#index as HTML
2014-02-13T20:38:00.089740+00:00 app[web.1]: PG::Error: FATAL: terminating connection due to administrator command
2014-02-13T20:38:00.089740+00:00 app[web.1]: SSL connection has been closed unexpectedly
2014-02-13T20:38:00.089740+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T20:38:00.089740+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team
2014-02-13T20:38:00.089740+00:00 app[web.1]: PG::Error: FATAL: terminating connection due to administrator command
2014-02-13T20:38:00.091753+00:00 app[web.1]: Rendered live_players/index.html.erb within layouts/application (4.7ms)
2014-02-13T20:38:00.092187+00:00 app[web.1]: Completed 500 Internal Server Error in 3373ms
2014-02-13T20:38:00.096530+00:00 app[web.1]:
2014-02-13T20:38:00.096530+00:00 app[web.1]: ActionView::Template::Error (PG::Error: FATAL: terminating connection due to administrator command
2014-02-13T20:38:00.096530+00:00 app[web.1]: SSL connection has been closed unexpectedly
2014-02-13T20:38:00.096530+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team):
2014-02-13T20:38:00.096530+00:00 app[web.1]: 9: <% Abbrv.order("Team").each do |abbrv| %>
2014-02-13T20:38:00.089740+00:00 app[web.1]: SSL connection has been closed unexpectedly
2014-02-13T20:38:00.096530+00:00 app[web.1]: 7: <select id = "FilterTm">
2014-02-13T20:38:00.096530+00:00 app[web.1]: 10: <option><%= abbrv.Team %></option>
2014-02-13T20:38:00.096530+00:00 app[web.1]: 11: <% end %>
2014-02-13T20:38:00.096859+00:00 app[web.1]: 12: </select>
2014-02-13T20:38:00.096859+00:00 app[web.1]: ActionView::Template::Error (PG::Error: FATAL: terminating connection due to administrator command
2014-02-13T20:38:00.096859+00:00 app[web.1]: SSL connection has been closed unexpectedly
2014-02-13T20:38:00.096530+00:00 app[web.1]: 8: <option>Select a Team...</option>
2014-02-13T20:38:00.096859+00:00 app[web.1]: app/views/live_players/index.html.erb:9:in `_app_views_live_players_index_html_erb__
2392315387062206729_69827916979320'
2014-02-13T20:38:00.096859+00:00 app[web.1]:
2014-02-13T20:38:00.096859+00:00 app[web.1]:
2014-02-13T20:38:00.091873+00:00 app[web.1]: Rendered live_players/index.html.erb within layouts/application (4.7ms)
2014-02-13T20:38:00.096859+00:00 app[web.1]: : SELECT "abbrvs".* FROM "abbrvs" ORDER BY Team):
2014-02-13T20:38:00.096859+00:00 app[web.1]: 6:
2014-02-13T20:38:00.096859+00:00 app[web.1]: 7: <select id = "FilterTm">
2014-02-13T20:38:00.097200+00:00 app[web.1]: 8: <option>Select a Team...</option>
2014-02-13T20:38:00.097200+00:00 app[web.1]: 9: <% Abbrv.order("Team").each do |abbrv| %>
2014-02-13T20:38:00.097200+00:00 app[web.1]: 10: <option><%= abbrv.Team %></option>
2014-02-13T20:38:00.097200+00:00 app[web.1]: 11: <% end %>
2014-02-13T20:38:00.096859+00:00 app[web.1]:
2014-02-13T20:38:00.092187+00:00 app[web.1]: Completed 500 Internal Server Error in 3373ms
2014-02-13T20:38:00.097200+00:00 app[web.1]: app/views/live_players/index.html.erb:9:in `_app_views_live_players_index_html_erb__
2392315387062206729_69827916979320'
2014-02-13T20:38:00.097200+00:00 app[web.1]:
2014-02-13T20:38:00.097200+00:00 app[web.1]:
2014-02-13T20:38:00.097200+00:00 app[web.1]: 12: </select>
2014-02-13T20:38:00.096530+00:00 app[web.1]: 6:
2014-02-13T20:37:47.810030+00:00 heroku[router]: at=info method=GET path=/ host=whispering-shore-8429.herokuapp.com request_id=a91b
2a9e-24c1-4481-a973-e6385393035f fwd="68.55.131.71" dyno=web.1 connect=30ms service=113ms status=304 bytes=0
2014-02-13T20:38:00.106578+00:00 heroku[router]: at=info method=GET path=/live_players host=whispering-shore-8429.herokuapp.com request_id=a8c5e9d7-bac5-4058-87d0-497330b5c4dd fwd="68.55.131.71" dyno=web.1 connect=6ms service=3399ms status=500 bytes=1266`
答案 0 :(得分:0)
这是你的错误:
ActionView::Template::Error (PG::Error: ERROR: column "team" does not exist...
我的猜测是您通过迁移更新了数据库,但没有在Heroku上执行此操作。只需从控制台运行以下命令即可。
heroku run rake db:migrate
那应该可以解决你的错误。