引脚中的ActiveRecord :: StatementInvalid #index显示/app/app/views/pins/index.html.erb第4行引发:

时间:2013-08-28 05:50:32

标签: ruby-on-rails ruby git heroku

我git从github推送heroku master用于我的项目,但是当我打开heroku时它会说

引脚#index

中的ActiveRecord :: StatementInvalid

显示/app/app/views/pins/index.html.erb第4行:

PG::UndefinedTable: ERROR:  relation "pins" does not exist
LINE 5:              WHERE a.attrelid = '"pins"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"pins"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum


Extracted source (around line #4):

1: <%= render 'pages/home' %>
2: 
3: <div id="pins">
4:   <%= render @pins %>
5: </div>
6: 
7: <%= will_paginate @pins %>

有人可以帮忙吗?它在本地工作正常,但我得到应用程序部署在Heroku上。非常感谢。

1 个答案:

答案 0 :(得分:2)

错误PG::UndefinedTable: ERROR: relation "pins" does not exist

表示缺少该表。您必须在Heroku

上迁移数据库

推送到Heroku后,您可以执行heroku run rake db:migrate