14

我已将我的一个应用程序的 rails 版本升级到 4.1.0。在升级时,我已经升级了 Gemfile 中的所有 gem,它也将 act-as-taggable-on 升级到了 3.1.1。

但是升级后,当我尝试在相应的对象上添加标签时,它失败并出现以下错误。

  post = Post.last
  post.tag_list = "development"
  post.save

错误:列“taggings_count”不存在

细节错误在这里:

SQL (0.9ms)  UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
PG::UndefinedColumn: ERROR:  column "taggings_count" does not exist
LINE 1: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_coun...
                                                      ^
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
   (0.3ms)  ROLLBACK
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "taggings_count" does not exist
LINE 1: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_coun...
                                                      ^
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
4

1 回答 1

28

只是我们必须做的,

rakeacts_as_taggable_on_engine:install:migrations

由于acts-as-taggable-on 添加了新的迁移。

于 2014-04-23T09:03:13.183 回答