ActiveRecord ::引脚中的StatementInvalid#index显示/app/app/views/pins/index.html.erb其中行#4引发的位置: [英] ActiveRecord::StatementInvalid in Pins#index Showing /app/app/views/pins/index.html.erb where line #4 raised:
问题描述
$ b $ p
ActiveRecord :: StatementInvalid in Pins#index
$ git b$ b
显示/app/app/views/pins/index.html.erb其中第4行产生:
PG :: UndefinedTable:ERROR:关系pins不存在
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
提取的源代码(在第4行左右):
1:<%=呈现'网页/主页'%>
2:
3:< div id =pins>
4:<%= render @pins%>
5:< / div>
6:
7:<%= will_paginate @pins%>
有人可以帮忙吗?它在本地工作正常,但我得到的应用程序部署在Heroku上。非常感谢。
错误 PG :: UndefinedTable:ERROR:relationpinsdoes not exist
,
表示表格丢失。您必须在 Heroku
上迁移数据库当您推送到 Heroku
,你可以做 heroku run rake db:migrate
I git pushed heroku master for my project from github, but when I do heroku open it says
ActiveRecord::StatementInvalid in Pins#index
Showing /app/app/views/pins/index.html.erb where line #4 raised:
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 %>
Can someone help? It works fine locally, but I get the app to deploy on Heroku. Much appreciated.
The error PG::UndefinedTable: ERROR: relation "pins" does not exist
,
means that the table is missing. You have to migrate the database on Heroku
After you push to Heroku
, you can do heroku run rake db:migrate
这篇关于ActiveRecord ::引脚中的StatementInvalid#index显示/app/app/views/pins/index.html.erb其中行#4引发的位置:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!