Ruby on rails 无栏“;标记“U计数”;使用make_可与Rails 4一起标记

Ruby on rails 无栏“;标记“U计数”;使用make_可与Rails 4一起标记,ruby-on-rails,sqlexception,Ruby On Rails,Sqlexception,我正在开发Rails 4应用程序,并安装了make_可标记的gem(如下),以允许用户喜欢帖子。每当我尝试将用户设置为post(在浏览器或控制台上)时,它总是向我显示以下错误: SQLite3::SQLException:没有这样的列:flaggings_count:更新“posts”设置“flaggings_count”=合并(“flaggings_count”,0)+1,其中“posts”。“id”=67 以下是我喜欢的方法: def like @post = Post.find(par

我正在开发Rails 4应用程序,并安装了make_可标记的gem(如下),以允许用户喜欢帖子。每当我尝试将用户设置为post(在浏览器或控制台上)时,它总是向我显示以下错误:

SQLite3::SQLException:没有这样的列:flaggings_count:更新“posts”设置“flaggings_count”=合并(“flaggings_count”,0)+1,其中“posts”。“id”=67

以下是我喜欢的方法:

def like
  @post = Post.find(params[:id])
  current_user.flag(@post, :like)
  redirect_to posts_path, :notice => "You now like this post"
end
迁移看起来还可以,有人发生过吗?
提前谢谢

看起来它正在使用带有标记计数的计数器缓存

执行迁移,并将标记计数列添加到posts表中

def change
  add_column :post, :flaggings_count, :integer
end

谢谢必须对用户表执行相同的操作