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

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

我正在使用 rails 4、ruby 2.3,但遇到了问题。如何解决这个错误?

PG::UndefinedTable: ERROR: relation "carrinho" does not exist LINE 1: SELECT "carrinho".* FROM "carrinho" WHERE "carrinho"."id" I... ^ : SELECT "carrinho".* FROM "carrinho" WHERE "carrinho"."id" IS NULL LIMIT 1

我的模特是carrinho.rb 我的控制器是 carrinhos_controller.rb 我的观点是 carrinhos 我的迁移是 20160204181641_create_carrinhos.rb

并在变化中有:

  inflect.plural "carrinhos", "carrinhos"
  inflect.plural "carrinho", "carrinhos"
  inflect.singular "carrinhos", "carrinho"
  inflect.singular "carrinho", "carrinho"
  inflect.irregular 'carrinho', 'carrinhos'

花一周时间尝试解决这个问题。请帮帮我!!

我解决了这个问题,我刚好从 inflect.irregular "carrinho", "carrinhos" 的位置开始,成功了! 我不知道顺序会影响,但现在我不会再误会了。希望对大家有帮助。