我已经按照链接中的说明安装了 Gem Ahoy -> https://github.com/ankane/ahoy
将此行添加到应用程序的 Gemfile:
gem 'ahoy_matey'
并在 jQuery 之后添加 app/assets/javascripts/application.js 中的 javascript 文件。
//= require jquery
//= require ahoy
MySQL 或 SQLite
将 activeuuid 添加到您的 Gemfile。
gem 'activeuuid', '>= 0.5.0'
并运行:
rails generate ahoy:stores:active_record
rake db:migrate
最后一个命令产生以下错误
rake db:migrate
== CreateVisits: migrating ===================================================
-- create_table(:visits, {:id=>false})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedObject: ERROR: type "binary" does not exist
LINE 1: CREATE TABLE "visits" ("id" binary(16) PRIMARY KEY, "visitor...