0

我从github为我的项目推送了heroku master,但是当我打开heroku时它说

ActiveRecord::StatementInvalid in Pins#index

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

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 上。非常感激。

4

1 回答 1

2

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

表示该表丢失。您必须将数据库迁移到Heroku

推到之后Heroku,你可以做heroku run rake db:migrate

于 2013-08-28T06:19:28.890 回答