2016-11-14 134 views
0
$heroku logs --tail 
Started GET "/" for 46.188.182.234 at 2016-11-14 20:51:53 +0000 
2016-11-14T20:51:53.840163+00:00 app[web.1]: [21c27115-512c-4e9e-bb24-8e1d8b0a46ca] Processing by StaticPagesController#home as HTML 
2016-11-14T20:51:53.850654+00:00 app[web.1]: [21c27115-512c-4e9e-bb24-8e1d8b0a46ca] Rendering static_pages/home.html.erb within layouts/application 
2016-11-14T20:51:53.856619+00:00 app[web.1]: [21c27115-512c-4e9e-bb24-8e1d8b0a46ca] Rendered static_pages/home.html.erb within layouts/application (5.7ms) 
2016-11-14T20:51:53.859704+00:00 app[web.1]: [21c27115-512c-4e9e-bb24-8e1d8b0a46ca] Completed 200 OK in 19ms (Views: 11.1ms | ActiveRecord: 0.0ms) 
2016-11-14T20:51:59.479887+00:00 heroku[router]: at=info method=GET path="/signup" host=damp-reef-30485.herokuapp.com request_id=79382bce-34fd-4faa-958c-15b6ce8adf1f fwd="46.188.182.234" dyno=web.1 connect=1ms service=64ms status=500 bytes=1733 
2016-11-14T20:51:59.487241+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] Started GET "/signup" for 46.188.182.234 at 2016-11-14 20:51:59 +0000 
2016-11-14T20:51:59.495254+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] Processing by UsersController#new as HTML 
2016-11-14T20:51:59.509968+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] Completed 500 Internal Server Error in 14ms (ActiveRecord: 1.6ms) 
2016-11-14T20:51:59.511411+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] 
2016-11-14T20:51:59.511456+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist 
2016-11-14T20:51:59.511457+00:00 app[web.1]: LINE 8:    WHERE a.attrelid = '"users"'::regclass 
2016-11-14T20:51:59.511457+00:00 app[web.1]:           ^
2016-11-14T20:51:59.511458+00:00 app[web.1]: :    SELECT a.attname, format_type(a.atttypid, a.atttypmod), 
2016-11-14T20:51:59.511458+00:00 app[web.1]:      pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, 
2016-11-14T20:51:59.511459+00:00 app[web.1]:    (SELECT c.collname FROM pg_collation c, pg_type t 
2016-11-14T20:51:59.511459+00:00 app[web.1]:    WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation), 
2016-11-14T20:51:59.511460+00:00 app[web.1]:      col_description(a.attrelid, a.attnum) AS comment 
2016-11-14T20:51:59.511460+00:00 app[web.1]:     FROM pg_attribute a LEFT JOIN pg_attrdef d 
2016-11-14T20:51:59.511461+00:00 app[web.1]:     ON a.attrelid = d.adrelid AND a.attnum = d.adnum 
2016-11-14T20:51:59.511461+00:00 app[web.1]:    WHERE a.attrelid = '"users"'::regclass 
2016-11-14T20:51:59.511462+00:00 app[web.1]:     AND a.attnum > 0 AND NOT a.attisdropped 
2016-11-14T20:51:59.511462+00:00 app[web.1]:    ORDER BY a.attnum 
2016-11-14T20:51:59.511463+00:00 app[web.1]:): 
2016-11-14T20:51:59.511491+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] 
2016-11-14T20:51:59.511536+00:00 app[web.1]: [79382bce-34fd-4faa-958c-15b6ce8adf1f] app/controllers/users_controller.rb:17:in `new' 

正如你所看到的,我得到的主页,但是当我尝试获得注册表单时,我得到了错误。本地一切正常,REST对用户资源的操作在本地工作正常。 此输出对我而言很有趣:部署Rails应用程序后Heroku状态500错误

"PG::UndefinedTable: ERROR: relation "users" does not exist" 

请帮忙,谢谢。

回答

1

**此问题是因为出现了一些迁移issue.To起来的Heroku迁移输入下面的命令**

heroku run rake db:migrate 

在此之后,检查所有的迁移是否向上或not.If你与迁移任何问题的检查。

+0

我检查了个人迁移,看到有些迁移标记funcionality出现问题,所以我用'rails销毁迁移CreateTaggins'并且现在一切正常。谢谢 – piga

1

你需要运行在Heroku上迁移,只需在您的项目中的shell中运行:

heroku run rails db:migrate

相关问题