PG :: UndefinedColumn:错误:列sections.row_order不存在

桑勋
<% @course.sections.rank(:row_order).each do |section| %>
    <br /><br />
        <div class="section">
            <h3>
                <%= section.title %>
            </h3>

我在部分中获得该行顺序的未定义列。这是我的部分模型...

class Section < ActiveRecord::Base
belongs_to :course
has_many :lessons

include RankedModel
ranks :row_order, :with_same => :course_id
end

这是我的移民。

class AlterSectionsAddRowOrder < ActiveRecord::Migration
  def change
    add_column :sections, :row_order, :integer
    add_index :sections, :row_order
  end
end

如果这有用,这是我收到的错误消息。

在2015-05-07 23:41:49 +0000,由CoursesController#show以HTML参数形式进行处理,开始针对10.0.2.2的GET“ / courses / 13”:{“ id” =>“ 13”}课程负载(0.5毫秒) SELECT“ courses”。*从“ courses”哪里“ courses ..” id“ = $ 1 LIMIT 1 [[” id“,” 13“]]用户负载(0.5ms)SELECT” users“。* FROM” users“哪里“ users”。“ id” = 2 ORDER BY“ users”。“ id” ASC LIMIT 1用户负载(0.5ms)选择“ users”。* FROM“ users” WHERE“ users”。“ id” = $ 1 ORDER BY“ users“。” id“ ASC LIMIT 1 [[” id“,2]]课程已存在(0.4ms)从“课程”内联接中选择1作为“课程”内的“入学”。“ id” =“入学”。 ”course_id“ WHERE”注册“。” user_id“ = $ 1 AND” courses“。” id“ = 13 LIMIT 1 [[”“ user_id”,2]]区域加载(1.0ms)选择“ sections .. *”在“ sections”中“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC [[”“ course_id”,13]] PG :: UndefinedColumn:错误:列sections.row_order不存在LINE 1:... ons“ WHERE“ sections ..” course_id“ = $ 1 ORDER BY” sections“ ... ^:选择” sections“。* FROM” sections“ WHERE” sections。“” course_id“ = $ 1 ORDER BY” sections“。” row_order“ ASC在布局/应用程序中呈现的courses / show.html.erb(57.0毫秒)在240毫秒内完成了500个内部服务器错误enrollments“。” user_id“ = $ 1 AND” courses“。” id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(1.0ms)选择” sections“。*从” sections“中选择” sections“。 “ course_id” = $ 1 ORDER BY“ sections”。“行顺序” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” sections“所在的位置。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现的课程/节目布局/应用程序中的.html.erb(57.0毫秒)在240毫秒内完成了500个内部服务器错误enrollments“。” user_id“ = $ 1 AND” courses“。” id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(1.0ms)选择” sections“。*从” sections“中选择” sections“。 “ course_id” = $ 1 ORDER BY“ sections”。“行顺序” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” sections“所在的位置。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现的课程/节目布局/应用程序中的.html.erb(57.0毫秒)在240毫秒内完成了500个内部服务器错误id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(1.0ms)选择” sections“。*从” sections“位置” sections。“” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” WHERE“ sections ..” course_id“ = $ 1 ORDER BY” sections“ ... ^:选择“ sections”。*从“ sections”那里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC在布局/应用程序中呈现的courses / show.html.erb(57.0ms)已完成500内部服务器错误(240毫秒)id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(1.0ms)选择” sections“。*从” sections“位置” sections。“” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” WHERE“ sections ..” course_id“ = $ 1 ORDER BY” sections“ ... ^:选择“ sections”。*从“ sections”那里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC在布局/应用程序中呈现的courses / show.html.erb(57.0ms)已完成500内部服务器错误(240毫秒)section“。” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列sections.row_order不存在第1行:...在哪里” “ sections”。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现布局/应用程序内的courses / show.html.erb(57.0毫秒)在240毫秒内完成了500个内部服务器错误section“。” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列sections.row_order不存在第1行:...在哪里” “ sections”。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现布局/应用程序内的courses / show.html.erb(57.0毫秒)在240毫秒内完成了500个内部服务器错误= $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections”哪里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC渲染的课程/show.html.erb在版面/应用程序中(57.0毫秒),在240毫秒内完成500个内部服务器错误= $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections”哪里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC渲染的课程/show.html.erb在版面/应用程序中(57.0毫秒),在240毫秒内完成500个内部服务器错误

ActionView :: Template :: Error(PG :: UndefinedColumn:错误:列sections.row_order不存在LINE 1:...在“ WHERE” sections ..“ course_id” = $ 1 ORDER BY“ sections ...... ^:从“ sections”中选择“ sections”。*在“ sections”中的“ sections”中。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC):42:43:44:45:<%@ course.sections.rank(: row_order).each do | section |%> 46:

47:48:app / views / courses / show.html.erb:45:in'_app_views_courses_show_html_erb___522001594__582727588'

渲染的/home/vagrant/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb(2.0 ms)呈现的/home/vagrant/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.9毫秒)呈现的/home/vagrant/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/template_error .erb在救援/版式内(19.6ms)

在2015-05-07 23:41:51 +0000由CoursesController#show以HTML参数的形式开始针对10.0.2.2的GET“ / courses / 13”,HTML参数:{“ id” =>“ 13”}课程负载(0.5ms) SELECT“ courses”。*从“ courses”哪里“ courses ..” id“ = $ 1 LIMIT 1 [[” id“,” 13“]]用户负载(0.6ms)SELECT” users“。* FROM” users“哪里“ users”。“ id” = 2 ORDER BY“ users”。“ id” ASC LIMIT 1用户负载(0.5ms)选择“ users”。* FROM“ users” WHERE“ users”。“ id” = $ 1 ORDER BY“ users“。” id“ ASC LIMIT 1 [[” id“,2]]课程已存在(0.3ms)从” courses“内联接中选择1 as” enrollments“在” courses“上。” id“ =” enrollments“。 ”course_id“ WHERE”报名“。” user_id“ = $ 1 AND” courses“。” id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(0.7ms)选择” sections .. *“在” sections“中“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC [[”“ course_id”,13]] PG :: UndefinedColumn:错误:列sections.row_order不存在LINE 1:... ons“ WHERE“ sections ..” course_id“ = $ 1 ORDER BY” sections“ ... ^:选择” sections“。* FROM” sections“ WHERE” sections。“” course_id“ = $ 1 ORDER BY” sections“。” row_order“ ASC在布局/应用程序中呈现的courses / show.html.erb(51.8毫秒)在163毫​​秒内完成了500个内部服务器错误enrollments“。” user_id“ = $ 1 AND” courses“。” id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(0.7ms)选择” sections“。*从” sections“中选择” sections“。 “ course_id” = $ 1 ORDER BY“ sections”。“行顺序” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” sections“所在的位置。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现的课程/节目布局/应用程序中的.html.erb(51.8毫秒)在163毫​​秒内完成了500个内部服务器错误enrollments“。” user_id“ = $ 1 AND” courses“。” id“ = 13 LIMIT 1 [[” user_id“,2]]部分加载(0.7ms)选择” sections“。*从” sections“中选择” sections“。 “ course_id” = $ 1 ORDER BY“ sections”。“行顺序” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” sections“所在的位置。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现的课程/节目布局/应用程序中的.html.erb(51.8毫秒)在163毫​​秒内完成了500个内部服务器错误id“ = 13 LIMIT 1 [[” user_id“,2]]节加载(0.7ms)选择” sections .. *“在” sections“中,在” sections。“中。” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” WHERE“ sections ..” course_id“ = $ 1 ORDER BY” sections“ ... ^:选择“ sections”。*从“ sections”那里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC在布局/应用程序中呈现的courses / show.html.erb(51.8ms)已完成500内部服务器错误(163ms)id“ = 13 LIMIT 1 [[” user_id“,2]]节加载(0.7ms)选择” sections .. *“在” sections“中,在” sections。“中。” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列section.row_order不存在LINE 1:...在” WHERE“ sections ..” course_id“ = $ 1 ORDER BY” sections“ ... ^:选择“ sections”。*从“ sections”那里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC在布局/应用程序中呈现的courses / show.html.erb(51.8ms)已完成500内部服务器错误(163ms)section“。” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列sections.row_order不存在LINE 1:...在”“ “ sections”。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现布局/应用程序中的courses / show.html.erb(51.8毫秒)在163毫​​秒内完成了500个内部服务器错误section“。” course_id“ = $ 1 ORDER BY” sections ..“ row_order” ASC [[“” course_id“,13]] PG :: UndefinedColumn:错误:列sections.row_order不存在LINE 1:...在”“ “ sections”。“ course_id” = $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections” WHERE“ sections ..”“ course_id” = $ 1 ORDER BY“ sections”。“ row_order” ASC呈现布局/应用程序中的courses / show.html.erb(51.8毫秒)在163毫​​秒内完成了500个内部服务器错误= $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections”哪里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC渲染的课程/show.html.erb在版面/应用程序中(51.8ms)在163ms内完成500个内部服务器错误= $ 1 ORDER BY“ sections” ... ^:选择“ sections”。*从“ sections”哪里“ sections”。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC渲染的课程/show.html.erb在版面/应用程序中(51.8ms)在163ms内完成500个内部服务器错误

ActionView :: Template :: Error(PG :: UndefinedColumn:错误:列sections.row_order不存在LINE 1:...在“ WHERE” sections ..“ course_id” = $ 1 ORDER BY“ sections ...... ^:从“ sections”中选择“ sections”。*在“ sections”中的“ sections”中。“ course_id” = $ 1 ORDER BY“ sections ..” row_order“ ASC):42:43:44:45:<%@ course.sections.rank(: row_order).each do | section |%> 46:

47:48:app / views / courses / show.html.erb:45:in'_app_views_courses_show_html_erb___522001594__582727588'

渲染的/home/vagrant/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb(3.6 ms)呈现的/home/vagrant/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.3毫秒)呈现的/home/vagrant/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/templates/rescues/template_error .erb在救援/版式内(21.3ms)

蒂姆·霍尔特(Tim Holt)

我的直接猜测是您忘记了运行迁移,并且此列从未添加。您可以通过查看db / schema.rb文件来确认该列存在(并且已运行迁移)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Sidekiq PG :: UndefinedColumn:错误:不存在

来自分类Dev

耙db:migrate错误'PG :: UndefinedColumn:错误:列“子弹”不存在”

来自分类Dev

ActionView :: Template :: Error(PG :: UndefinedColumn:错误:列“ weeknumber”不存在

来自分类Dev

PG :: UndefinedColumn:错误:列photos.attachable_type不存在

来自分类Dev

经典队列返回PG :: UndefinedColumn:错误:列“ pid”不存在

来自分类Dev

PG :: UndefinedColumn:错误:关系“事件”的列“ city_id”不存在

来自分类Dev

收到错误PG :: UndefinedColumn:错误:使用Geocoder的near方法时,列mymodels.distance不存在

来自分类Dev

收到错误PG :: UndefinedColumn:错误:使用Geocoder的near方法时,列mymodels.distance不存在

来自分类Dev

Pg:错误列不存在

来自分类Dev

活动管理员多对多显示索引PG :: UndefinedColumn:错误:列cases.product_id不存在

来自分类Dev

PG :: UndefinedTable:错误:关系不存在

来自分类Dev

Rails:PG :: UndefinedTable:错误:关系“ ...”不存在

来自分类Dev

耙子流产了!PG :: UndefinedTable:错误:关系“页面”不存在

来自分类Dev

pg_restore错误:角色XXX不存在

来自分类Dev

PG :: UndefinedTable:错误:关系“音乐家”不存在

来自分类Dev

耙子流产了!PG :: UndefinedTable:错误:关系“页面”不存在

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ guestbooks”不存在

来自分类Dev

PG::UndefinedTable:错误:关系“洞穴”不存在

来自分类Dev

Heroku +公寓PG ::错误:错误:函数pg_stat_statements_reset()不存在

来自分类Dev

PG :: UndefinedObject:错误:类型“ hstore”不存在,但确实存在

来自分类Dev

ActionView :: Template :: Error(PG :: UndefinedFunction:错误:运算符不存在:整数~~未知

来自分类Dev

Heroku / Rails:PG ::未定义表:在Heroku Rails迁移上不存在错误“ [[tablename]””

来自分类Dev

PG :: UndefinedFunction:错误:运算符不存在:text =布尔值

来自分类Dev

PG :: UndefinedTable:错误:关系“ active_storage_blobs”不存在

来自分类Dev

pg_restore错误:函数raise_err(未知)不存在

来自分类Dev

PG :: UndefinedFunction:错误:运算符不存在:字符变化@>点

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ spree_orders”不存在

来自分类Dev

PG::UndefinedTable:错误:关系“”不存在 - Amazon EC2、Postgresql 和 Rails 5

来自分类Dev

pg_restore 错误:“关系不存在”并创建新数据库

Related 相关文章

  1. 1

    Sidekiq PG :: UndefinedColumn:错误:不存在

  2. 2

    耙db:migrate错误'PG :: UndefinedColumn:错误:列“子弹”不存在”

  3. 3

    ActionView :: Template :: Error(PG :: UndefinedColumn:错误:列“ weeknumber”不存在

  4. 4

    PG :: UndefinedColumn:错误:列photos.attachable_type不存在

  5. 5

    经典队列返回PG :: UndefinedColumn:错误:列“ pid”不存在

  6. 6

    PG :: UndefinedColumn:错误:关系“事件”的列“ city_id”不存在

  7. 7

    收到错误PG :: UndefinedColumn:错误:使用Geocoder的near方法时,列mymodels.distance不存在

  8. 8

    收到错误PG :: UndefinedColumn:错误:使用Geocoder的near方法时,列mymodels.distance不存在

  9. 9

    Pg:错误列不存在

  10. 10

    活动管理员多对多显示索引PG :: UndefinedColumn:错误:列cases.product_id不存在

  11. 11

    PG :: UndefinedTable:错误:关系不存在

  12. 12

    Rails:PG :: UndefinedTable:错误:关系“ ...”不存在

  13. 13

    耙子流产了!PG :: UndefinedTable:错误:关系“页面”不存在

  14. 14

    pg_restore错误:角色XXX不存在

  15. 15

    PG :: UndefinedTable:错误:关系“音乐家”不存在

  16. 16

    耙子流产了!PG :: UndefinedTable:错误:关系“页面”不存在

  17. 17

    ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ guestbooks”不存在

  18. 18

    PG::UndefinedTable:错误:关系“洞穴”不存在

  19. 19

    Heroku +公寓PG ::错误:错误:函数pg_stat_statements_reset()不存在

  20. 20

    PG :: UndefinedObject:错误:类型“ hstore”不存在,但确实存在

  21. 21

    ActionView :: Template :: Error(PG :: UndefinedFunction:错误:运算符不存在:整数~~未知

  22. 22

    Heroku / Rails:PG ::未定义表:在Heroku Rails迁移上不存在错误“ [[tablename]””

  23. 23

    PG :: UndefinedFunction:错误:运算符不存在:text =布尔值

  24. 24

    PG :: UndefinedTable:错误:关系“ active_storage_blobs”不存在

  25. 25

    pg_restore错误:函数raise_err(未知)不存在

  26. 26

    PG :: UndefinedFunction:错误:运算符不存在:字符变化@>点

  27. 27

    ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ spree_orders”不存在

  28. 28

    PG::UndefinedTable:错误:关系“”不存在 - Amazon EC2、Postgresql 和 Rails 5

  29. 29

    pg_restore 错误:“关系不存在”并创建新数据库

热门标签

归档