首页 \ 问答 \ Rails Heroku应用程序错误(Rails Heroku app errors)

Rails Heroku应用程序错误(Rails Heroku app errors)

我的项目在当地运作良好。 我将它部署到Heroku。 我有一些错误,应用程序无法运行。 我正在使用rails 4和postgresql。 无法理解为什么会发生这种情况。 在我看来,数据库没有创建。 我应该在我的database.yml中添加指定生产设置吗?

database.yml的

development:
  adapter: postgresql
  encoding: utf8
  database: test_store_dev
  pool: 5
  username: mike
  password: mike
  host: 127.0.0.1

test:
  adapter: postgresql
  encoding: utf8
  database: test_store_test
  pool: 5
  username: mike
  password: mike
  host: 127.0.0.1

从日志:

~/workspace/test_store$ heroku logs --tail
2014-02-13T13:14:47.731382+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.731535+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.731382+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.731972+00:00 app[web.1]: I, [2014-02-13T13:13:06.802166 #2]  INFO -- : Started GET "/" for 46.53.195.24 at 2014-02-13 13:13:06 +0000
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2014-02-13T13:14:47.731972+00:00 app[web.1]: I, [2014-02-13T13:13:06.807361 #2]  INFO -- :   Rendered shared/_search_form.html.erb (0.6ms)
2014-02-13T13:14:47.731972+00:00 app[web.1]: E, [2014-02-13T13:13:06.810210 #2] ERROR -- : PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.731972+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-02-13T13:14:47.731972+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.731972+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"
2014-02-13T13:14:47.732116+00:00 app[web.1]: I, [2014-02-13T13:13:06.813303 #2]  INFO -- :   Rendered categories/index.html.erb within layouts/application (6.7ms)
2014-02-13T13:14:47.731972+00:00 app[web.1]: I, [2014-02-13T13:13:06.805622 #2]  INFO -- : Processing by CategoriesController#index as HTML
2014-02-13T13:14:47.732116+00:00 app[web.1]: F, [2014-02-13T13:13:06.819692 #2] FATAL -- : 
2014-02-13T13:14:47.732116+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732116+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732116+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.732116+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.732116+00:00 app[web.1]:     4:   <%= render :partial => '/shared/search_form' %>
2014-02-13T13:14:47.732116+00:00 app[web.1]:     5: 
2014-02-13T13:14:47.732271+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.732116+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732116+00:00 app[web.1]: I, [2014-02-13T13:13:06.814571 #2]  INFO -- : Completed 500 Internal Server Error in 9ms
2014-02-13T13:14:47.731683+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-02-13T13:14:47.731683+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2014-02-13T13:14:47.732271+00:00 app[web.1]:   app/views/categories/index.html.erb:6:in `_app_views_categories_index_html_erb___3515298162048279666_69853047486040'
2014-02-13T13:14:47.732271+00:00 app[web.1]: 
2014-02-13T13:14:47.732271+00:00 app[web.1]: 
2014-02-13T13:14:47.732271+00:00 app[web.1]: I, [2014-02-13T13:14:42.123367 #2]  INFO -- : Started GET "/" for 46.53.195.24 at 2014-02-13 13:14:42 +0000
2014-02-13T13:14:47.732271+00:00 app[web.1]:     8:       <h3> <%= link_to category.name, products_path(:category => category.slug)  %> </h3>
2014-02-13T13:14:47.732271+00:00 app[web.1]:     7:     <div class="col-md-4">
2014-02-13T13:14:47.732429+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"
2014-02-13T13:14:47.732429+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732429+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732598+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.732598+00:00 app[web.1]:     4:   <%= render :partial => '/shared/search_form' %>
2014-02-13T13:14:47.732598+00:00 app[web.1]:     5: 
2014-02-13T13:14:47.732598+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.732598+00:00 app[web.1]:     7:     <div class="col-md-4">
2014-02-13T13:14:47.732598+00:00 app[web.1]:     8:       <h3> <%= link_to category.name, products_path(:category => category.slug)  %> </h3>
2014-02-13T13:14:47.732429+00:00 app[web.1]: I, [2014-02-13T13:14:42.134755 #2]  INFO -- :   Rendered categories/index.html.erb within layouts/application (9.8ms)
2014-02-13T13:14:47.732743+00:00 app[web.1]: 
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.723691 #2]  INFO -- :   Rendered shared/_search_form.html.erb (0.6ms)
2014-02-13T13:14:47.732743+00:00 app[web.1]: E, [2014-02-13T13:14:47.728029 #2] ERROR -- : PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732743+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732598+00:00 app[web.1]:   app/views/categories/index.html.erb:6:in `_app_views_categories_index_html_erb___3515298162048279666_69853047486040'
2014-02-13T13:14:47.732598+00:00 app[web.1]: 
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.729251 #2]  INFO -- : Completed 500 Internal Server Error in 11ms
2014-02-13T13:14:47.732886+00:00 app[web.1]: F, [2014-02-13T13:14:47.731100 #2] FATAL -- : 
2014-02-13T13:14:47.732886+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732886+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732886+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.732743+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732886+00:00 app[web.1]:     5: 
2014-02-13T13:14:47.732886+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.732886+00:00 app[web.1]:     7:     <div class="col-md-4">
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-02-13T13:14:47.733034+00:00 app[web.1]:     9: 
2014-02-13T13:14:47.733034+00:00 app[web.1]:     8:       <h3> <%= link_to category.name, products_path(:category => category.slug)  %> </h3>
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-02-13T13:14:47.733034+00:00 app[web.1]: 
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-02-13T13:14:47.732886+00:00 app[web.1]:     4:   <%= render :partial => '/shared/search_form' %>
2014-02-13T13:14:47.733034+00:00 app[web.1]:   app/views/categories/index.html.erb:6:in `_app_views_categories_index_html_erb___3515298162048279666_69853047486040'
2014-02-13T13:14:47.733034+00:00 app[web.1]: 
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-02-13T13:14:47.731972+00:00 app[web.1]: 
2014-02-13T13:14:47.731972+00:00 app[web.1]: 
2014-02-13T13:14:47.731972+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-02-13T13:14:47.732271+00:00 app[web.1]: I, [2014-02-13T13:14:42.124293 #2]  INFO -- : Processing by CategoriesController#index as HTML
2014-02-13T13:14:47.732271+00:00 app[web.1]: I, [2014-02-13T13:14:42.127769 #2]  INFO -- :   Rendered shared/_search_form.html.erb (0.5ms)
2014-02-13T13:14:47.732271+00:00 app[web.1]:     9: 
2014-02-13T13:14:47.732429+00:00 app[web.1]: I, [2014-02-13T13:14:42.134928 #2]  INFO -- : Completed 500 Internal Server Error in 11ms
2014-02-13T13:14:47.732429+00:00 app[web.1]: F, [2014-02-13T13:14:42.136566 #2] FATAL -- : 
2014-02-13T13:14:47.732429+00:00 app[web.1]: E, [2014-02-13T13:14:42.131964 #2] ERROR -- : PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732429+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732429+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732429+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732598+00:00 app[web.1]:     9: 
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.715526 #2]  INFO -- : Started GET "/" for 46.53.195.24 at 2014-02-13 13:14:47 +0000
2014-02-13T13:14:47.732598+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.732743+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.729098 #2]  INFO -- :   Rendered categories/index.html.erb within layouts/application (6.1ms)
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.717991 #2]  INFO -- : Processing by CategoriesController#index as HTML
2014-02-13T13:14:47.732886+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.732886+00:00 app[web.1]:                                    ^
2014-02-13T13:14:42.190691+00:00 heroku[router]: at=info method=GET path=/ host=thawing-mesa-8086.herokuapp.com request_id=fa0aa0ee-7720-49c0-a2c4-271131bf6688 fwd="46.53.195.24" dyno=web.1 connect=0ms service=75ms status=500 bytes=1266

My project works well locally. I deployed it to Heroku. I've got some errors and app couldn't run there. I'm using rails 4 with postgresql. Can't understand why this is happens. It seems to me that database wasn't created. Should I add specify production settings on my database.yml?

database.yml

development:
  adapter: postgresql
  encoding: utf8
  database: test_store_dev
  pool: 5
  username: mike
  password: mike
  host: 127.0.0.1

test:
  adapter: postgresql
  encoding: utf8
  database: test_store_test
  pool: 5
  username: mike
  password: mike
  host: 127.0.0.1

From log:

~/workspace/test_store$ heroku logs --tail
2014-02-13T13:14:47.731382+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.731535+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.731382+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.731972+00:00 app[web.1]: I, [2014-02-13T13:13:06.802166 #2]  INFO -- : Started GET "/" for 46.53.195.24 at 2014-02-13 13:13:06 +0000
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2014-02-13T13:14:47.731972+00:00 app[web.1]: I, [2014-02-13T13:13:06.807361 #2]  INFO -- :   Rendered shared/_search_form.html.erb (0.6ms)
2014-02-13T13:14:47.731972+00:00 app[web.1]: E, [2014-02-13T13:13:06.810210 #2] ERROR -- : PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.731972+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-02-13T13:14:47.731972+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.731972+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"
2014-02-13T13:14:47.732116+00:00 app[web.1]: I, [2014-02-13T13:13:06.813303 #2]  INFO -- :   Rendered categories/index.html.erb within layouts/application (6.7ms)
2014-02-13T13:14:47.731972+00:00 app[web.1]: I, [2014-02-13T13:13:06.805622 #2]  INFO -- : Processing by CategoriesController#index as HTML
2014-02-13T13:14:47.732116+00:00 app[web.1]: F, [2014-02-13T13:13:06.819692 #2] FATAL -- : 
2014-02-13T13:14:47.732116+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732116+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732116+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.732116+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.732116+00:00 app[web.1]:     4:   <%= render :partial => '/shared/search_form' %>
2014-02-13T13:14:47.732116+00:00 app[web.1]:     5: 
2014-02-13T13:14:47.732271+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.732116+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732116+00:00 app[web.1]: I, [2014-02-13T13:13:06.814571 #2]  INFO -- : Completed 500 Internal Server Error in 9ms
2014-02-13T13:14:47.731683+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-02-13T13:14:47.731683+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2014-02-13T13:14:47.732271+00:00 app[web.1]:   app/views/categories/index.html.erb:6:in `_app_views_categories_index_html_erb___3515298162048279666_69853047486040'
2014-02-13T13:14:47.732271+00:00 app[web.1]: 
2014-02-13T13:14:47.732271+00:00 app[web.1]: 
2014-02-13T13:14:47.732271+00:00 app[web.1]: I, [2014-02-13T13:14:42.123367 #2]  INFO -- : Started GET "/" for 46.53.195.24 at 2014-02-13 13:14:42 +0000
2014-02-13T13:14:47.732271+00:00 app[web.1]:     8:       <h3> <%= link_to category.name, products_path(:category => category.slug)  %> </h3>
2014-02-13T13:14:47.732271+00:00 app[web.1]:     7:     <div class="col-md-4">
2014-02-13T13:14:47.732429+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"
2014-02-13T13:14:47.732429+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732429+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732598+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.732598+00:00 app[web.1]:     4:   <%= render :partial => '/shared/search_form' %>
2014-02-13T13:14:47.732598+00:00 app[web.1]:     5: 
2014-02-13T13:14:47.732598+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.732598+00:00 app[web.1]:     7:     <div class="col-md-4">
2014-02-13T13:14:47.732598+00:00 app[web.1]:     8:       <h3> <%= link_to category.name, products_path(:category => category.slug)  %> </h3>
2014-02-13T13:14:47.732429+00:00 app[web.1]: I, [2014-02-13T13:14:42.134755 #2]  INFO -- :   Rendered categories/index.html.erb within layouts/application (9.8ms)
2014-02-13T13:14:47.732743+00:00 app[web.1]: 
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.723691 #2]  INFO -- :   Rendered shared/_search_form.html.erb (0.6ms)
2014-02-13T13:14:47.732743+00:00 app[web.1]: E, [2014-02-13T13:14:47.728029 #2] ERROR -- : PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732743+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732598+00:00 app[web.1]:   app/views/categories/index.html.erb:6:in `_app_views_categories_index_html_erb___3515298162048279666_69853047486040'
2014-02-13T13:14:47.732598+00:00 app[web.1]: 
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.729251 #2]  INFO -- : Completed 500 Internal Server Error in 11ms
2014-02-13T13:14:47.732886+00:00 app[web.1]: F, [2014-02-13T13:14:47.731100 #2] FATAL -- : 
2014-02-13T13:14:47.732886+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732886+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732886+00:00 app[web.1]:     3: 
2014-02-13T13:14:47.732743+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732886+00:00 app[web.1]:     5: 
2014-02-13T13:14:47.732886+00:00 app[web.1]:     6:   <% Category.roots.each do |category| %>
2014-02-13T13:14:47.732886+00:00 app[web.1]:     7:     <div class="col-md-4">
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-02-13T13:14:47.733034+00:00 app[web.1]:     9: 
2014-02-13T13:14:47.733034+00:00 app[web.1]:     8:       <h3> <%= link_to category.name, products_path(:category => category.slug)  %> </h3>
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-02-13T13:14:47.733034+00:00 app[web.1]: 
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-02-13T13:14:47.732886+00:00 app[web.1]:     4:   <%= render :partial => '/shared/search_form' %>
2014-02-13T13:14:47.733034+00:00 app[web.1]:   app/views/categories/index.html.erb:6:in `_app_views_categories_index_html_erb___3515298162048279666_69853047486040'
2014-02-13T13:14:47.733034+00:00 app[web.1]: 
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-02-13T13:14:47.731828+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-02-13T13:14:47.731972+00:00 app[web.1]: 
2014-02-13T13:14:47.731972+00:00 app[web.1]: 
2014-02-13T13:14:47.731972+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-02-13T13:14:47.732271+00:00 app[web.1]: I, [2014-02-13T13:14:42.124293 #2]  INFO -- : Processing by CategoriesController#index as HTML
2014-02-13T13:14:47.732271+00:00 app[web.1]: I, [2014-02-13T13:14:42.127769 #2]  INFO -- :   Rendered shared/_search_form.html.erb (0.5ms)
2014-02-13T13:14:47.732271+00:00 app[web.1]:     9: 
2014-02-13T13:14:47.732429+00:00 app[web.1]: I, [2014-02-13T13:14:42.134928 #2]  INFO -- : Completed 500 Internal Server Error in 11ms
2014-02-13T13:14:47.732429+00:00 app[web.1]: F, [2014-02-13T13:14:42.136566 #2] FATAL -- : 
2014-02-13T13:14:47.732429+00:00 app[web.1]: E, [2014-02-13T13:14:42.131964 #2] ERROR -- : PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732429+00:00 app[web.1]: LINE 1: SELECT "categories".* FROM "categories"  WHERE "categories"....
2014-02-13T13:14:47.732429+00:00 app[web.1]:                                    ^
2014-02-13T13:14:47.732429+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "categories" does not exist
2014-02-13T13:14:47.732598+00:00 app[web.1]:     9: 
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.715526 #2]  INFO -- : Started GET "/" for 46.53.195.24 at 2014-02-13 13:14:47 +0000
2014-02-13T13:14:47.732598+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.732743+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.729098 #2]  INFO -- :   Rendered categories/index.html.erb within layouts/application (6.1ms)
2014-02-13T13:14:47.732743+00:00 app[web.1]: I, [2014-02-13T13:14:47.717991 #2]  INFO -- : Processing by CategoriesController#index as HTML
2014-02-13T13:14:47.732886+00:00 app[web.1]: : SELECT "categories".* FROM "categories"  WHERE "categories"."parent_id" IS NULL  ORDER BY "categories"."lft"):
2014-02-13T13:14:47.732886+00:00 app[web.1]:                                    ^
2014-02-13T13:14:42.190691+00:00 heroku[router]: at=info method=GET path=/ host=thawing-mesa-8086.herokuapp.com request_id=fa0aa0ee-7720-49c0-a2c4-271131bf6688 fwd="46.53.195.24" dyno=web.1 connect=0ms service=75ms status=500 bytes=1266

原文:https://stackoverflow.com/questions/21755977
更新时间:2022-08-29 12:08

最满意答案

1)是的,你不需要在应用程序中有一个生产apk,你可以上传你的apk在阿尔法进行一些测试然后你可以选择apk并将其移动到测试版,然后在市场上公开。 它还支持Staged rollouts。

请按照本指南管理您的应用测试组。 ( Beta测试和分阶段推出

2)在Google Play开发者控制台中无法做到这一点。 这必须在清单中使用:

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true"
    android:xlargeScreens="true"/>

更多信息在这里。 ( 支持屏幕 )和这里( 使用功能

您还可以添加更多必需的功能。 当您将apk上传到Google Play时,您可以查看有多少设备对您的应用有效或被排除。 然后,只有符合您要求的设备才能在商店中看到该应用程序。

在这里输入图像描述

祝你好运


1) Yes you don't need to have a production apk in the app, you can upload your apk in alpha for some testing then you can select the apk and move it to beta and then make it public on market. It also supports Staged rollouts.

Follow this guide to manage your app testing groups. (Beta-testing and staged rollouts)

2) No this can't be done in Google play developer console. This has to be done in the manifest using this:

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true"
    android:xlargeScreens="true"/>

more information here. (support-screens) and here (uses-feature)

You can also add more required features. And when you upload the apk to google play , you can check how many devices are valid for your app, or excluded. Then only devices that meat your requirements can see the application in the store.

enter image description here

Good Luck

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)