即使rspec中没有错误,在进行新提交后也不会显示Heroku应用页面

时间:2013-10-19 17:17:31

标签: ruby-on-rails git heroku ruby-on-rails-4

我在Heroku上有一个黑客新闻克隆,我克隆它进行更改,以便投票可以按日期排序,也可以按投票计数排序。那很顺利,然后我用rspec测试,确保我都是绿色的。最后,我推到了Heroku,这也很好,没有报错。

然而,当我访问网址时,它说“我们很抱歉,但出了点问题。”通常情况下,我会排除故障,但部署或rspec中没有消息,所以我不知道该怎么办?如果有人遇到过这个或者可以为我推荐一些东西,我会很感激。这是运行rspec和部署后的终端输出:

Finished in 0.60271 seconds
11 examples, 0 failures

Randomized with seed 33033

jasonrodriguez:infinite-castle-2099 jasonrodriguez$ git add . -A
jasonrodriguez:infinite-castle-2099 jasonrodriguez$ git commit -m "verifying that this app is committed"
# On branch master
nothing to commit, working directory clean
jasonrodriguez:infinite-castle-2099 jasonrodriguez$ git push heroku master
Everything up-to-date
jasonrodriguez:infinite-castle-2099 jasonrodriguez$ 

我是通过主分支jasonrodriguez:infinite-castle-2099 jasonrodriguez$ git branch * master

完成的

我跑了heroku logs --tail,它给了我这个:

jasonrodriguez:infinite-castle-2099 jasonrodriguez$ heroku logs --tail
2013-10-19T17:03:32.558564+00:00 app[web.1]: LINE 1: ...8695' AND '2013-10-19 17:03:32.548861')  ORDER BY votes_coun...
2013-10-19T17:03:32.558717+00:00 app[web.1]:     10:   </thead>
2013-10-19T17:03:32.558717+00:00 app[web.1]:     12:     <% Link.most_voted.each do |link| %>
2013-10-19T17:03:32.558717+00:00 app[web.1]:      9:     </tr>
2013-10-19T17:03:32.558717+00:00 app[web.1]: 
2013-10-19T17:03:33.819411+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=infinite-castle-2099.herokuapp.com fwd="67.170.184.10" dyno=web.1 connect=1ms service=11ms status=200 bytes=0
2013-10-19T17:24:26.167584+00:00 app[web.1]: PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:24:26.163272+00:00 app[web.1]: Started GET "/" for 67.170.184.10 at 2013-10-19 17:24:26 +0000
2013-10-19T17:24:26.163272+00:00 app[web.1]: Started GET "/" for 67.170.184.10 at 2013-10-19 17:24:26 +0000
2013-10-19T17:24:26.167584+00:00 app[web.1]:                                                              ^
2013-10-19T17:24:26.167584+00:00 app[web.1]: LINE 1: ...4736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_coun...
2013-10-19T17:24:26.167584+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:24:26.164736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_count DESC LIMIT 100
2013-10-19T17:24:26.167584+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:24:26.164736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_count DESC LIMIT 100
2013-10-19T17:24:26.167584+00:00 app[web.1]: PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:24:26.167584+00:00 app[web.1]:                                                              ^
2013-10-19T17:24:26.168406+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2013-10-19T17:24:26.170324+00:00 app[web.1]: 
2013-10-19T17:24:26.170324+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:24:26.175677+00:00 heroku[router]: at=info method=GET path=/ host=infinite-castle-2099.herokuapp.com fwd="67.170.184.10" dyno=web.1 connect=2ms service=13ms status=500 bytes=1266
2013-10-19T17:24:26.164068+00:00 app[web.1]: Processing by LinksController#index as HTML
2013-10-19T17:24:26.164068+00:00 app[web.1]: Processing by LinksController#index as HTML
2013-10-19T17:24:26.170324+00:00 app[web.1]:     11:   <tbody class="stories">
2013-10-19T17:24:26.170324+00:00 app[web.1]:                                                              ^
2013-10-19T17:24:26.170324+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:24:26.164736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_count DESC LIMIT 100):
2013-10-19T17:24:26.170479+00:00 app[web.1]:     15:                    <%= f.submit  '▲' %>
2013-10-19T17:24:26.170479+00:00 app[web.1]: 
2013-10-19T17:24:26.168250+00:00 app[web.1]:   Rendered links/index.html.erb within layouts/application (3.6ms)
2013-10-19T17:24:26.170479+00:00 app[web.1]:   app/views/links/index.html.erb:12:in `_app_views_links_index_html_erb___4309851234159801657_70037839513200'
2013-10-19T17:24:26.170626+00:00 app[web.1]:     13:           <%= form_for link.votes.new do |f| %>
2013-10-19T17:24:26.170324+00:00 app[web.1]:     13:           <%= form_for link.votes.new do |f| %>
2013-10-19T17:24:26.170479+00:00 app[web.1]: LINE 1: ...4736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_coun...
2013-10-19T17:24:26.170626+00:00 app[web.1]:     12:     <% Link.most_voted.each do |link| %>
2013-10-19T17:24:26.170324+00:00 app[web.1]:      9:     </tr>
2013-10-19T17:24:26.170479+00:00 app[web.1]:                                                              ^
2013-10-19T17:24:26.170626+00:00 app[web.1]:   app/views/links/index.html.erb:12:in `_app_views_links_index_html_erb___4309851234159801657_70037839513200'
2013-10-19T17:24:26.170626+00:00 app[web.1]:      9:     </tr>
2013-10-19T17:24:26.170479+00:00 app[web.1]:     14:                    <%= f.hidden_field :link_id %>
2013-10-19T17:24:26.170626+00:00 app[web.1]:     11:   <tbody class="stories">
2013-10-19T17:24:26.170626+00:00 app[web.1]:     10:   </thead>
2013-10-19T17:24:26.167584+00:00 app[web.1]: LINE 1: ...4736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_coun...
2013-10-19T17:24:26.168489+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2013-10-19T17:24:26.170324+00:00 app[web.1]: LINE 1: ...4736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_coun...
2013-10-19T17:24:26.170479+00:00 app[web.1]: 
2013-10-19T17:24:26.170479+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:24:26.170626+00:00 app[web.1]:     15:                    <%= f.submit  '▲' %>
2013-10-19T17:24:26.168250+00:00 app[web.1]:   Rendered links/index.html.erb within layouts/application (3.6ms)
2013-10-19T17:24:26.170324+00:00 app[web.1]:     10:   </thead>
2013-10-19T17:24:26.170479+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:24:26.164736' AND '2013-10-19 17:24:26.164831')  ORDER BY votes_count DESC LIMIT 100):
2013-10-19T17:24:26.170324+00:00 app[web.1]:     12:     <% Link.most_voted.each do |link| %>
2013-10-19T17:24:26.170479+00:00 app[web.1]: 
2013-10-19T17:24:26.170626+00:00 app[web.1]:     14:                    <%= f.hidden_field :link_id %>
2013-10-19T17:24:26.170626+00:00 app[web.1]: 
2013-10-19T17:24:26.170626+00:00 app[web.1]: 
2013-10-19T17:25:15.524381+00:00 app[web.1]: Started GET "/" for 99.90.16.79 at 2013-10-19 17:25:15 +0000
2013-10-19T17:25:15.529687+00:00 app[web.1]:   Rendered links/index.html.erb within layouts/application (3.8ms)
2013-10-19T17:25:15.529083+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:25:15.525998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_count DESC LIMIT 100
2013-10-19T17:25:15.524381+00:00 app[web.1]: Started GET "/" for 99.90.16.79 at 2013-10-19 17:25:15 +0000
2013-10-19T17:25:15.525289+00:00 app[web.1]: Processing by LinksController#index as HTML
2013-10-19T17:25:15.529083+00:00 app[web.1]: PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:25:15.525289+00:00 app[web.1]: Processing by LinksController#index as HTML
2013-10-19T17:25:15.531524+00:00 app[web.1]:                                                              ^
2013-10-19T17:25:15.531695+00:00 app[web.1]: 
2013-10-19T17:25:15.529083+00:00 app[web.1]:                                                              ^
2013-10-19T17:25:15.529083+00:00 app[web.1]: PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:25:15.529083+00:00 app[web.1]: LINE 1: ...5998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_coun...
2013-10-19T17:25:15.529083+00:00 app[web.1]: LINE 1: ...5998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_coun...
2013-10-19T17:25:15.529083+00:00 app[web.1]:                                                              ^
2013-10-19T17:25:15.531695+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:25:15.525998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_count DESC LIMIT 100):
2013-10-19T17:25:15.529798+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2013-10-19T17:25:15.531841+00:00 app[web.1]:     10:   </thead>
2013-10-19T17:25:15.531841+00:00 app[web.1]:      9:     </tr>
2013-10-19T17:25:15.531841+00:00 app[web.1]: 
2013-10-19T17:25:15.531841+00:00 app[web.1]: 
2013-10-19T17:25:15.529687+00:00 app[web.1]:   Rendered links/index.html.erb within layouts/application (3.8ms)
2013-10-19T17:25:15.529083+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:25:15.525998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_count DESC LIMIT 100
2013-10-19T17:25:15.531841+00:00 app[web.1]:     11:   <tbody class="stories">
2013-10-19T17:25:15.531524+00:00 app[web.1]: : SELECT  "links".* FROM "links"  WHERE ("links"."created_at" BETWEEN '2013-10-12 17:25:15.525998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_count DESC LIMIT 100):
2013-10-19T17:25:15.529798+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2013-10-19T17:25:15.531524+00:00 app[web.1]:     11:   <tbody class="stories">
2013-10-19T17:25:15.531524+00:00 app[web.1]: LINE 1: ...5998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_coun...
2013-10-19T17:25:15.531524+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:25:15.531524+00:00 app[web.1]:     10:   </thead>
2013-10-19T17:25:15.531695+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedColumn: ERROR:  column "votes_count" does not exist
2013-10-19T17:25:15.531695+00:00 app[web.1]: LINE 1: ...5998' AND '2013-10-19 17:25:15.526107')  ORDER BY votes_coun...
2013-10-19T17:25:15.531524+00:00 app[web.1]: 
2013-10-19T17:25:15.531524+00:00 app[web.1]:     12:     <% Link.most_voted.each do |link| %>
2013-10-19T17:25:15.531841+00:00 app[web.1]:   app/views/links/index.html.erb:12:in `_app_views_links_index_html_erb___4309851234159801657_70037839513200'
2013-10-19T17:25:15.531695+00:00 app[web.1]:     14:                    <%= f.hidden_field :link_id %>
2013-10-19T17:25:15.531524+00:00 app[web.1]:     13:           <%= form_for link.votes.new do |f| %>
2013-10-19T17:25:15.531695+00:00 app[web.1]: 
2013-10-19T17:25:15.531695+00:00 app[web.1]:     15:                    <%= f.submit  '▲' %>
2013-10-19T17:25:15.531841+00:00 app[web.1]:     12:     <% Link.most_voted.each do |link| %>
2013-10-19T17:25:15.531695+00:00 app[web.1]:   app/views/links/index.html.erb:12:in `_app_views_links_index_html_erb___4309851234159801657_70037839513200'
2013-10-19T17:25:15.531841+00:00 app[web.1]:     13:           <%= form_for link.votes.new do |f| %>
2013-10-19T17:25:15.531524+00:00 app[web.1]:      9:     </tr>
2013-10-19T17:25:15.531695+00:00 app[web.1]: 
2013-10-19T17:25:15.531841+00:00 app[web.1]:     15:                    <%= f.submit  '▲' %>
2013-10-19T17:25:15.531695+00:00 app[web.1]:                                                              ^
2013-10-19T17:25:15.531841+00:00 app[web.1]:     14:                    <%= f.hidden_field :link_id %>
2013-10-19T17:25:16.054820+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=infinite-castle-2099.herokuapp.com fwd="99.90.16.79" dyno=web.1 connect=2ms service=10ms status=200 bytes=0
2013-10-19T17:25:15.537591+00:00 heroku[router]: at=info method=GET path=/ host=infinite-castle-2099.herokuapp.com fwd="99.90.16.79" dyno=web.1 connect=2ms service=14ms status=500 bytes=1266

显然,它说它找不到votes_count,即使它就在我的架构中.rb:

  create_table "links", force: true do |t|
    t.string   "description"
    t.string   "url"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "user_id"
    t.integer  "votes_count"
  end

1 个答案:

答案 0 :(得分:1)

  

然而,当我访问网址时,它说“我们很抱歉,但出了点问题。”

在您的终端中运行

heroku logs --tail

分析日志您还可以刷新页面以查看最新日志。请尝试查找错误并将其粘贴到此处,以便我们为您提供更多帮助

修改

尝试在heroku上运行迁移

heroku run rake db:migrate