我按照链接中的说明安装了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...